waylonflinn/markdown-it-katex

TeX isn't parseable

Opened this issue · 3 comments

As part of what I do with Markdown, I have to parse the Markdown itself, token by token. For text, I normally just use the token's content.

However, in TeX code within Markdown, parsing breaks due to backslashes in the TeX being interpreted as escapes. For example, the code

$1+1 \, = 2$

Will be parsed as

$1 + 1 , = 2$

Producing a comma in the rendered TeX, when \, should be a 'small space'.

I'm not sure if this is even within scope of this package, but if this plugin could adjust the parsing so that escapes don't break the TeX that'd be amazing.

Good catch, thanks! Hopefully #4 will get us close to a fix for this.

If you'll add an example of expected behaviour, I'll turn it into a test case.

I actually don't need this any more - d'you want me to make a PR with a test in it anyway? :) Thanks for this library!