Nested math parsed incorrectly
edemaine opened this issue · comments
$\colorbox{aqua}{$F=ma$}$
currently parses as two math chunks, $\colorbox{aqua}{$
and $}$
, which is not correct.
Would you be willing to either add, or review a PR to add, proper brace handling so that this properly parses? For an example of how this can be done, see https://github.com/KaTeX/KaTeX/blob/master/contrib/auto-render/splitAtDelimiters.js
This bug is currently hampering the actual KaTeX documentation, which uses your plugin (!). See KaTeX/KaTeX#2280 (review)
Hi Erik! Yes, please feel free to submit anything which will resolve your issue. Thanks!
And just to be sure: the solution will be to properly track '{}' levels to then ignore any embedded '$' characters.
Actually, I went ahead and implemented the fix after upgrading KaTeX to 0.11.1. My test passes.