trentm / python-markdown2

markdown2: A fast and complete implementation of Markdown in Python
Other
2.65k stars 432 forks source link

LaTeX to MathML support #134

Open lucianmarin opened 11 years ago

lucianmarin commented 11 years ago

It will be great to have LaTeX support with markdown2. LaTeX code that can be converted to MathML:

$$
    x = \frac{-b \pm \sqrt{b^2 -4ac}}{2a}
$$

Everything between $$ should be rendered as MathML code inside a math tag.

Marked app as an example.

0xl3x1 commented 10 years ago

I second this. It would be a fantastic feature to add as an 'extra', I think.

nicholasserra commented 10 years ago

Pull Requests are welcome and encouraged :D

thehappycheese commented 6 months ago

I am here from trying to fix an issue in pdoc

pdoc runs MathJax.typeset() (in the browser) after the page is generated in python using markdown2.markdown(). This results in an awkward conflict to do with backslash escaping \\

To fix the problem I am trying to understand this unexpected behaviour of markdown2: It seems to incorrectly handle escaping of backslashes if a docstring is an r-string?

image


edit: The problem is definitly with pdoc. I think markdown2 is working as intended.