Currently, mdBook-KaTeX uses simple heuristics I hand-rolled to identify and extract math expressions. Various Markdown markups are not handled, e.g., indented code blocks and HTML.
Recently, Pulldown-CMark started supporting math. This is some great news, as Pulldown-CMark should be much more robust and feature-rich in this regard.
Context
Currently, mdBook-KaTeX uses simple heuristics I hand-rolled to identify and extract math expressions. Various Markdown markups are not handled, e.g., indented code blocks and HTML.
Recently, Pulldown-CMark started supporting math. This is some great news, as Pulldown-CMark should be much more robust and feature-rich in this regard.
To reliably convert Pulldown-CMark events back to Markdown text, it would also be nice to wait until Pulldown-CMark-to-Cmark supports preserving escape characters.
Pushback
The reasons I am not very interested in implementing this myself are as follows:
If anyone is interested in this, please try and make a PR!