Fix plain text MathML output

pull/9/head
trivernis 4 years ago
parent 1340b17104
commit 7d4c906a12

@ -2,7 +2,7 @@
name = "asciimath-rs" name = "asciimath-rs"
description = "AsciiMath parser" description = "AsciiMath parser"
repository = "https://github.com/trivernis/asciimath-rs" repository = "https://github.com/trivernis/asciimath-rs"
version = "0.4.4" version = "0.4.5"
authors = ["trivernis <trivernis@protonmail.com>"] authors = ["trivernis <trivernis@protonmail.com>"]
edition = "2018" edition = "2018"
readme = "README.md" readme = "README.md"

@ -84,12 +84,12 @@ impl ToMathML for PlainText {
fn to_mathml(&self) -> String { fn to_mathml(&self) -> String {
if let Some(formatting) = &self.formatting { if let Some(formatting) = &self.formatting {
format!( format!(
"<mtext mathvariant='{}'/>{}</mtext>", "<mtext mathvariant='{}'>{}</mtext>",
formatting.to_mathml(), formatting.to_mathml(),
encode_minimal(self.text.as_str()) encode_minimal(self.text.as_str())
) )
} else { } else {
format!("<mtext/>{}</mtext>", encode_minimal(self.text.as_str())) format!("<mtext>{}</mtext>", encode_minimal(self.text.as_str()))
} }
} }
} }

Loading…
Cancel
Save