mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 17:06:53 +02:00
MDL-83794 editor_tiny: Fix typo in style name
This commit is contained in:
parent
7ca85dfd6e
commit
7d26c0264d
3 changed files with 3 additions and 3 deletions
2
lib/editor/tiny/amd/build/content.min.js
vendored
2
lib/editor/tiny/amd/build/content.min.js
vendored
|
@ -1,3 +1,3 @@
|
||||||
define("editor_tiny/content",["exports"],(function(_exports){Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.addSVGSupport=_exports.addMathMLSupport=void 0;_exports.addMathMLSupport=editor=>{editor.on("PreInit",(()=>{editor.schema.addCustomElements({math:{extends:"div"},"tiny-math-span":{extends:"span"},"tiny-math-block":{extends:"div"}}),editor.parser.addNodeFilter("math",(nodes=>nodes.forEach((node=>{if(node.parent&&("tiny-math-block"===node.parent.name||"tiny-math-span"===node.parent.name))return;const displayMode=(node=>{const style=node.attr("style");return null!=style&&style.includes("display")&&style.match(/dispaly:[^;]*inline/)?"tiny-math-span":"tiny-math-block"})(node);node.wrap(editor.editorManager.html.Node.create(displayMode,{contenteditable:"false"}))})))),editor.serializer.addNodeFilter("tiny-math-span, tiny-math-block",((nodes,name)=>nodes.forEach((node=>{const displayMode=name.replace("tiny-math-","");node.children().forEach((child=>{const currentStyle=child.attr("style");currentStyle?child.attr("style","".concat(currentStyle,";display: ").concat(displayMode)):child.attr("style","display: ".concat(displayMode))})),node.unwrap()}))))}))};_exports.addSVGSupport=editor=>{editor.on("PreInit",(()=>{editor.schema.addCustomElements({svg:{extends:"div"},"tiny-svg-block":{extends:"div"}}),editor.parser.addNodeFilter("svg",(nodes=>nodes.forEach((node=>{node.wrap(editor.editorManager.html.Node.create("tiny-svg-block",{contenteditable:"false"}))})))),editor.serializer.addNodeFilter("tiny-svg-block",(nodes=>nodes.forEach((node=>{node.unwrap()}))))}))}}));
|
define("editor_tiny/content",["exports"],(function(_exports){Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.addSVGSupport=_exports.addMathMLSupport=void 0;_exports.addMathMLSupport=editor=>{editor.on("PreInit",(()=>{editor.schema.addCustomElements({math:{extends:"div"},"tiny-math-span":{extends:"span"},"tiny-math-block":{extends:"div"}}),editor.parser.addNodeFilter("math",(nodes=>nodes.forEach((node=>{if(node.parent&&("tiny-math-block"===node.parent.name||"tiny-math-span"===node.parent.name))return;const displayMode=(node=>{const style=node.attr("style");return null!=style&&style.includes("display")&&style.match(/display:[^;]*inline/)?"tiny-math-span":"tiny-math-block"})(node);node.wrap(editor.editorManager.html.Node.create(displayMode,{contenteditable:"false"}))})))),editor.serializer.addNodeFilter("tiny-math-span, tiny-math-block",((nodes,name)=>nodes.forEach((node=>{const displayMode=name.replace("tiny-math-","");node.children().forEach((child=>{const currentStyle=child.attr("style");currentStyle?child.attr("style","".concat(currentStyle,";display: ").concat(displayMode)):child.attr("style","display: ".concat(displayMode))})),node.unwrap()}))))}))};_exports.addSVGSupport=editor=>{editor.on("PreInit",(()=>{editor.schema.addCustomElements({svg:{extends:"div"},"tiny-svg-block":{extends:"div"}}),editor.parser.addNodeFilter("svg",(nodes=>nodes.forEach((node=>{node.wrap(editor.editorManager.html.Node.create("tiny-svg-block",{contenteditable:"false"}))})))),editor.serializer.addNodeFilter("tiny-svg-block",(nodes=>nodes.forEach((node=>{node.unwrap()}))))}))}}));
|
||||||
|
|
||||||
//# sourceMappingURL=content.min.js.map
|
//# sourceMappingURL=content.min.js.map
|
File diff suppressed because one or more lines are too long
|
@ -30,7 +30,7 @@ export const addMathMLSupport = (editor) => {
|
||||||
const getNodeType = (node) => {
|
const getNodeType = (node) => {
|
||||||
const style = node.attr('style');
|
const style = node.attr('style');
|
||||||
if (style?.includes('display')) {
|
if (style?.includes('display')) {
|
||||||
if (style.match(/dispaly:[^;]*inline/)) {
|
if (style.match(/display:[^;]*inline/)) {
|
||||||
return 'tiny-math-span';
|
return 'tiny-math-span';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue