Skip to content

Conversation

@zerone0x
Copy link
Contributor

Summary

Fixes #10979

Enable nonStandard: true in marked-katex-extension to allow inline math expressions to be immediately followed by punctuation like ), ], }, ;, etc.

Problem

When inline math delimited with $...$ is immediately followed by punctuation (e.g., $\alpha$)), the math fails to render. This is because the standard regex in marked-katex-extension only allows whitespace and limited punctuation after the closing $.

Solution

The marked-katex-extension package already provides a nonStandard option that removes this restriction, allowing any character to follow the closing delimiter. This is the minimal change to fix the issue.

Changes

  • packages/ui/src/context/marked.tsx (+1 line): Add nonStandard: true to markedKatex config

Test Plan

  • In the web UI, enter $\alpha$) in a chat message
  • Expected: The Greek letter alpha followed by a closing parenthesis
  • Previously: KaTeX parsing error / math not rendered

🤖 Generated with Claude Code (issue-hunter-pro)

Enable `nonStandard: true` in marked-katex-extension to allow inline
math expressions to be immediately followed by punctuation like `)`,
`]`, `}`, etc.

Previously, `$\alpha$)` would fail to render because the standard
regex only allows whitespace and limited punctuation after the
closing `$`. The nonStandard option removes this restriction.

Fixes anomalyco#10979

Co-Authored-By: Claude <[email protected]>
@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@adamdotdevin adamdotdevin merged commit 9424f82 into anomalyco:dev Jan 28, 2026
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

KaTeX Inline Math Fails When Followed By Punctuation

2 participants