DLMathMLCompare
You can use this library to compare two MathML expressions
- Install via
npm install dl-mathml-compare
- Require in your code using
var DLMathMLCompare = require('dl-mathml-compare');
- Use in your code as
DLMathMLCompare('Your MathML expression here', 'Your another MathML expression');
- It will return
true
if matched otherwise returnsfalse
- Does styling insensitive MathML comparison
Example:
DLMathMLCompare('<math xmlns="http://www.w3.org/1998/Math/MathML"><mfrac><mn>1</mn><mrow><mn>2</mn><msqrt><mo> </mo></msqrt><mo> </mo></mrow></mfrac></math>', '<math xmlns="http://www.w3.org/1998/Math/MathML"><mfrac><mn>1</mn><mrow><mn>2</mn><msqrt/><mo> </mo></mrow></mfrac><mo> </mo><mo> </mo> </math> ');// This will return true