Small utility to convert from Microsoft's OMML to MathML
npm install omml2mathml
Small utility to convert from Microsoft's OMML to MathML.
This is by and large a port of the the omml2mathml.xsl XSLT that Microsoft ships with Office and
that is in relatively wide use, with a few bugs fixed. This implementation does not require an
XSLT processor (I built it because I became tired of XSLT processors that crash)
npm install omml2mathml
The API is very simple: there is only one function to know, it takes one input, runs synchronously,
and returns one output.
``js`
import omml2mathml from 'omml2mathml';
let mathmlElement = omml2mathml(oMathElement);
The input should be an m:oMath or m:oMathPara element. Note that you can always use the formerm:oMathPara
even if it has an parent and the module will correctly set display="block" all thexmldom
same. The object does not need to belong to any specific DOM implementation, it just needs to
support some basic DOM operations (roughyl DOM 2, and then again not all of it). For instance
the module will work fine.
It returns an instance of a math element as an HTML DOM object, as produced through theget-dom module, which is to say that if you are runningjsdom`.
this in the browser it will be the browser's implementation; if in Node it will be