0.0.2 • Published 2 years ago

mammoth-math v0.0.2

Weekly downloads
-
License
BSD-2-Clause
Repository
github
Last release
2 years ago

This is an extended version of npm package "mammoth". I added an indicator for OMML element read called </thisismath>. This indicator can be filled by others external math reader. Such as I am using "word-math" for my projects.

Usage

const mammoth = require('mammoth-math')
const word = require('word-math');

let data = await mammoth.convertToHtml({ path: docxFile.path })

const mathData = word.readFile(docxFile.path).maths
for (const mathElement of mathData) {
  data.value = data.value.replace(/&lt;\/thisismath&gt;/, mathElement)
}

console.log(data.value)