Skip to content
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

Mathjax support with parsed markdown fails #18

Open
auser opened this issue Dec 20, 2017 · 2 comments
Open

Mathjax support with parsed markdown fails #18

auser opened this issue Dec 20, 2017 · 2 comments

Comments

@auser
Copy link

auser commented Dec 20, 2017

Hi markdown-it team,

I should note at the offset that markdown-it + markdown-it-katex plugin parses most equations properly, except when there is markdown syntax in the equation.

Currently, I have a markdown document with a latex formula that looks like this:

\begin{equation}c_i = \begin{cases}
- \log{(\hat{y}_i)} & \text{for }y_i = 1 \\
- \log{(1 - \hat{y}_i)} & \text{for }y_i = 0
\end{cases}\end{equation}

Notice the - in the equation. Markdown-it sees these - marks and parses them as li elements which breaks the latex rendering (as latex doesn't know what to do with <ul><li>. Is there a way to tell markdown-it to skip rendering anything inside of the \begin{equation} and \end{equation} syntax? Alternative suggestions work too... I'm kind of stuck on this issue.

Thanks!

@MakerGYT
Copy link


markdown-it-latex2img

@zackw
Copy link

zackw commented Dec 2, 2022

This appears to be fixed if markdown-it-katex is used with a sufficiently new core markdown-it.

zackw added a commit to zackw/markdown-it-katex that referenced this issue Dec 3, 2022
Notably, katex goes from 0.6.0 to 0.16.0 and (for testing purposes
only) markdown-it from 6.0.0 to 13.0.0.  Several tests had to be
updated as katex’s HTML rendering of many math constructs has changed,
but no code changes are required.

Fixes issues waylonflinn#18, waylonflinn#19, waylonflinn#21, waylonflinn#27. Partially addresses waylonflinn#16.
Test cases added.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants