kivikakk / comrak

CommonMark + GFM compatible Markdown parser and renderer
Other
1.13k stars 134 forks source link

feature request: latex2mathml #208

Closed Tsai002 closed 1 week ago

Tsai002 commented 2 years ago

https://docs.rs/crate/latex2mathml/ is very easy to use. And cmark-syntax has integrated it https://github.com/grego/cmark-syntax/blob/057ed25507735aa013b55a0650845da5ff2c368e/src/lib.rs#L74, I hope comrak can support it.

kivikakk commented 2 years ago

I'd be happy to accept a PR that added (optional) integration!

Tsai002 commented 2 years ago

In my private project, I just convert

let input = latex2mathml::replace(input)?;
if input.contains("<math") && input.contains("</math>") {
    // skip the math part && convert to md
} else {
    // convert to md
}

That works, but looks awful.