You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we do not parse the nested structure of MathML, and simply treat it as a string. In math node’s toDOM(), we create a math element and assign that string to its innerHTML.
This is not a problem during offline rendering. However, react-prosemirror only allows returning array specs from toDOM(). Returning a DOM node causes an error when instantiating ProseMirror component. This is handled generically by falling back to pre-rendered HTML contents if any errors occurs when rendering the editor, so for now it’s not a significant issue, but it would be handy to handle math more properly.
One way of handling it more properly could be converting the MathML string to an array spec in toDOM(). There can probably be a generic function that converts a given serialized DOM string to PM array spec.
The text was updated successfully, but these errors were encountered:
For rendering MathML, the proper way is either use the default browser rendering or MathJax (WebKit MathML support is buggy). For accepting other math formats, please preprocess using Plurimath.
Firelight renders MathML as MathML and I intend to keep it that way (maybe adding a polyfill for unsupporting browsers, but that’s another ticket). The ticket is about a slightly different aspect.
Note metanorma/isodoc#642: from next release you will need to ignore stem, and process fmt-stem instead. This is to preserve the original MathML where number formatting has been introduced (and where MathML wrappers has been removed, in the case of standalone numbers).
Currently, we do not parse the nested structure of MathML, and simply treat it as a string. In math node’s
toDOM()
, we create a math element and assign that string to itsinnerHTML
.This is not a problem during offline rendering. However, react-prosemirror only allows returning array specs from
toDOM()
. Returning a DOM node causes an error when instantiating ProseMirror component. This is handled generically by falling back to pre-rendered HTML contents if any errors occurs when rendering the editor, so for now it’s not a significant issue, but it would be handy to handle math more properly.One way of handling it more properly could be converting the MathML string to an array spec in
toDOM()
. There can probably be a generic function that converts a given serialized DOM string to PM array spec.The text was updated successfully, but these errors were encountered: