-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected parsing _underline_ in $LaTeX$ #457
Comments
Funnily enough I'd been having my own go at integrating MathJax LaTeX into Parsedown. So here's a hack to do it for now (Parsedown may want to forgo parsing the actual mathjax latex syntax by default though). I opted to overload the (Obviously, those are both my decisions based entirely on my own preferences – so don't take those as an implied standard or anything) Branch here: https://github.com/aidantwoods/parsedown/tree/mathjaxlatex Because the text containing the LaTeX now has its own handler, we can avoid Parsedown trying to apply markdown to it. E.g.
test source: test text inline LaTeX: `x = \int_{0^1}^1(-b \pm \sqrt{b^2-4ac})/(2a)` more
inline text
```
x = \int_{0^1}^1(-b \pm \sqrt{b^2-4ac})/(2a)
```
```latex
x = \int_{0^1}^1(-b \pm \sqrt{b^2-4ac})/(2a)
```
`\Pi_{\text{Sno},\text{Cno}}(\text{SC})\div \Pi_{\text{Cno}}(\text{Course})
\bowtie \Pi_{\text{Sno},\text{Sname}}(\text{Student})`
```latex
\Pi_{\text{Sno},\text{Cno}}(\text{SC})\div \Pi_{\text{Cno}}(\text{Course})
\bowtie \Pi_{\text{Sno},\text{Sname}}(\text{Student})
```
```not-latex
\Pi_{\text{Sno},\text{Cno}}(\text{SC})\div \Pi_{\text{Cno}}(\text{Course})
\bowtie \Pi_{\text{Sno},\text{Sname}}(\text{Student})
```
* line item
``inlineCode`` output: <p>test text inline LaTeX: <span>\(x = \int_{0^1}^1(-b \pm \sqrt{b^2-4ac})/(2a)\)</span> more
inline text</p>
<pre><code>x = \int_{0^1}^1(-b \pm \sqrt{b^2-4ac})/(2a)</code></pre>
<span>$$
x = \int_{0^1}^1(-b \pm \sqrt{b^2-4ac})/(2a)
$$</span>
<p><span>\(\Pi_{\text{Sno},\text{Cno}}(\text{SC})\div \Pi_{\text{Cno}}(\text{Course}) \bowtie \Pi_{\text{Sno},\text{Sname}}(\text{Student})\)</span></p>
<span>$$
\Pi_{\text{Sno},\text{Cno}}(\text{SC})\div \Pi_{\text{Cno}}(\text{Course})
\bowtie \Pi_{\text{Sno},\text{Sname}}(\text{Student})
$$</span>
<pre><code class="language-not-latex">\Pi_{\text{Sno},\text{Cno}}(\text{SC})\div \Pi_{\text{Cno}}(\text{Course})
\bowtie \Pi_{\text{Sno},\text{Sname}}(\text{Student})</code></pre>
<ul>
<li>line item</li>
</ul>
<p><code>inlineCode</code></p> |
I tried it in demo.
There is a LaTeX formula in my markdown
And it is parsed to
in which the underlines
_
was parsed to<em></em>
and I do not expect that.What should I do to avoid this? Is it a bug or unsupported feature?
By the way, I am using mathjax to render this.
The text was updated successfully, but these errors were encountered: