Crates.io | mathml |
lib.rs | mathml |
version | 0.4.4 |
source | src |
created_at | 2020-04-18 14:23:00.349144 |
updated_at | 2020-04-18 17:45:24.782692 |
description | A parser for MathML |
homepage | |
repository | https://github.com/jlricon/mathml |
max_upload_size | |
id | 231539 |
size | 20,221 |
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
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);