mathml

Crates.iomathml
lib.rsmathml
version0.4.4
sourcesrc
created_at2020-04-18 14:23:00.349144
updated_at2020-04-18 17:45:24.782692
descriptionA parser for MathML
homepage
repositoryhttps://github.com/jlricon/mathml
max_upload_size
id231539
size20,221
Jose Luis Ricon (jlricon)

documentation

https://docs.rs/mathml/

README

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);
Commit count: 22

cargo fmt