Conversation
|
Docs Site preview: https://964fa568.rockgarden.pages.dev |
There was a problem hiding this comment.
The previously flagged $a increases and $b decreases issue is resolved: allow_space=False rejects any $token as a closing delimiter when the character immediately before it is a space, which covers the vast majority of prose dollar-variable patterns. The new test_dollar_variables_in_prose_not_math test confirms this.
One residual edge case remains (see inline comment), but the implementation is otherwise clean — CDN SRI hashes are present, textContent correctly unescapes HTML entities before passing to KaTeX, and the block class check for display mode is correct.
| _md = MarkdownIt("gfm-like", {"html": True, "breaks": True}) | ||
| footnote_plugin(_md) | ||
| tasklists_plugin(_md) | ||
| dollarmath_plugin(_md, allow_digits=False, allow_space=False) |
There was a problem hiding this comment.
Bug (Previously flagged — partially addressed): allow_space=False fixes the common $a increases and $b decreases case (space before closing $b blocks it), but slash-separated patterns like $HOME/$USER in plain prose are still consumed: the / before $USER is not whitespace, so HOME/ is wrapped as <span class="math inline">. The result with throwOnError: false is a KaTeX error badge rendered inline.
This is narrower than the previously flagged case — it only affects prose where two $identifier tokens are joined by a non-space, non-digit character without backtick quoting. Acceptable as a documented limitation, but worth a note in docs/Markdown Support.md under the Math section (e.g. "Avoid unquoted $var/path patterns in prose; use backticks instead").
No description provided.