-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
New formats parser / Backticks in math mode #533
Comments
Yuck, nice find. I don't see a clean way to fix this. The hacky way would be to process ticks and dollar signs in one pass, keeping track of being in vs. out of each type. But I think it's finally time to switch Coauthor's formats (in particular For formats other than Markdown, my plan is to then build my own "non-Markdown" processor that can run these same plugins, but with just a couple of simple rules for processing everything else (namely, HTML tags and text; and for LaTeX, some typography transmuting). I might build this out of At the same time, I could fix the argument parsing to LaTeX commands to do an actual scan with brace counting, instead of the current regular expression hack that has a limited brace depth. This was annoying to do when using Ideally the same plugins can be used for the Markdown syntax highlighter. Before doing this, we should consider whether to switch from markdown-it to remark/micromark. See comparison table. #212 somewhat related to this decision; apparently micromark can give position information but unclear whether remark can. |
Edit: This particular case was fixed. |
What's wrong?
Backticks in math mode produce unexpected results. I think
preprocessMarkdownTicks
replaces backticked expression withTICK0ENDTICK
, then KaTeX wraps each character in aspan
, andputTicksBack
can't findTICK0ENDTICK
anymore.I can't think of an easy way to fix this without breaking dollar-signs-in-code-blocks 😢.
How to Reproduce
https://coauthor.csail.mit.edu/coauthor-dev/m/mjhWj7zaP6H9ydm7A
Screenshots
The text was updated successfully, but these errors were encountered: