7 releases

0.4.4 Apr 18, 2020
0.4.3 Apr 18, 2020
0.2.0 Apr 18, 2020
0.1.0 Apr 18, 2020

#140 in #ci

33 downloads per month
Used in sbml

MIT/Apache

19KB
516 lines

Crates.io Documentation Build Codecov

Mathml parser

This implements a parser for the MathML spec https://www.w3.org/TR/2003/REC-MathML2-20031021/chapter4.html At the moment only content markup is implemented

Usage example

use mathml::parse_document;
let test = "<math xmlns=\"http://www.w3.org/1998/Math/MathML\">
                    <apply>
                  <plus/>
              <ci> x </ci>
              <ci> y </ci>
            </apply></math>";
let res = parse_document(test).unwrap();
let exp = Root(vec![Apply(vec![
    Op(BuiltinOp::plus),
    Ci(vec![Text("x".to_owned())]),
    Ci(vec![Text("y".to_owned())]),
])]);
assert_eq!(res, exp);

Dependencies

~0.8–1.5MB
~34K SLoC