Skip to content

Conversation

@Faizaanp
Copy link
Contributor

@Faizaanp Faizaanp commented Jan 6, 2026

The issue occurred because remarkGfm was processing underscores as emphasis markers before remarkMath could protect math blocks. By reordering the plugins, math expressions are now parsed first and remain intact.

Screenshots

before
image
after
image

Testing

Tested with $$\frac{1}{num\_workers}$$
Confirmed GFM features still work (tables, strikethrough, task lists)

image

- Move remarkMath plugin before remarkGfm to prevent underscore interpretation in LaTeX expressions
- Add katex.min.css import for proper math styling
- Fixes usememos#5427

The issue occurred because remarkGfm was processing underscores as emphasis markers before remarkMath could protect math blocks. By reordering the plugins, math expressions are now parsed first and remain intact.
@Faizaanp Faizaanp requested a review from johnnyjoygh as a code owner January 6, 2026 08:29
Copy link
Member

@boojack boojack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Faizaanp Faizaanp requested a review from boojack January 6, 2026 12:11
@boojack boojack merged commit 874a4a7 into usememos:main Jan 6, 2026
2 checks passed
@Faizaanp Faizaanp deleted the fix/katex-underscore-rendering branch January 7, 2026 05:25
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.

math formula render looks strange

2 participants