我知道我们可以创建 contentEditable p
、div
、span
等......
但是如何创建 contentEditablemath
元素,例如:
<math contenteditable>
.....
</math>
我知道我们可以创建 contentEditable p
、div
、span
等......
但是如何创建 contentEditablemath
元素,例如:
<math contenteditable>
.....
</math>
该contenteditable
属性是 HTML 的一部分,因此不希望它适用于 MathML 标记,并且测试表明相同。
在 HTML 中使用 MathML 时,可以将math
元素包装在可编辑的 HTML 容器中,例如<div contenteditable><math ...>...</math></div>
. 但是,尽管这使文本可编辑,但它似乎只能作为文本进行编辑。例如,当您<mi>A</mi>
在浏览器中通过将 A 替换为 B 进行编辑时,它在文档树中就变成了 B,一个没有标记的字符(因此以直立样式出现,而不是斜体)。
所以基本上答案似乎是“不”。</p>