@seewo-doc/mathml2omml

0.4.4 • Public • Published

mathml2omml

Convert MathML to the OOML format used in DOCX files without XSLT.

You can use it like this:

import {mml2omml} from "mathml2omml"

const mml = '<math xmlns="http://www.w3.org/1998/Math/MathML">
  <semantics>
    <mrow>
      <mn>2</mn>
      <mo>+</mo>
      <mn>2</mn>
      <mo>=</mo>
      <mn>4</mn>
    </mrow>
  </semantics>
</math>'

const omml = mml2omml(mml)

console.log(omml)

> <m:oMath xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math">
>    <m:r>
>        <m:t xml:space="preserve">2+2=4</m:t>
>    </m:r>
> </m:oMath>

License

LGPL v.3.0 or later.

The xml parser/stringifier in the parse-stringify-folder is based upon html-parse-stringify (MIT).

License of test files depends on source of files.

Some test fixtures fall under other licenses/copyrights. See the LICENSE and copyright.txt files in the different test fixture folders.

Remaining test fixtures fall under the same license and copyright as the source code.

Readme

Keywords

Package Sidebar

Install

npm i @seewo-doc/mathml2omml

Weekly Downloads

22

Version

0.4.4

License

LGPL-3.0-or-later

Unpacked Size

633 kB

Total Files

7

Last publish

Collaborators

  • elvin7cf
  • demian2u
  • tfuture
  • yaokailun