-
-
Notifications
You must be signed in to change notification settings - Fork 268
Closed
Labels
Description
Description
In Tex, the $$x$$ format is supposed to be used only on newlines.
But in practice, a lot of parsers support
The arithmetex modules here made the choice of treating inline $$x$$ as $x$, but there is a bug.
The matches occurs 2 times and we end up with a nested mathjax output.
Minimal Reproduction
foo = "hello $$x$$"
md = markdown.Markdown(extensions=[ArithmatexExtension()])
out = md.convert(foo)
print(out)Output is:
<p>hello <span class="arithmatex"><span class="MathJax_Preview"><span class="arithmatex"><span class="MathJax_Preview">x</span><script type="math/tex">x</script></span></span><script type="math/tex"><span class="arithmatex"><span class="MathJax_Preview">x</span><script type="math/tex">x</script></span></script></span></p>
It should be:
<p>hello <span class="arithmatex"><span class="MathJax_Preview">x</span><script type="math/tex">x</script></span></p>
Note: same behaviour with and without preview.
Version(s) & System Info
- Operating System: Linux
- Python Version: 3.14
- Package Version: latest
Reactions are currently unavailable