Skip to content

Commit 1841ccc

Browse files
committed
feat(web): add LaTeX math rendering support to ChatMarkdown
Support inline LaTeX \(...\) and block display LaTeX \[...\] / 79210...79210 delimiters in ChatMarkdown without mutating code blocks or ambient prose. Includes clean markdown math preprocessing, KaTeX styling and overflow containment, and markdown clipboard copy serialization.
1 parent 45a2c4b commit 1841ccc

7 files changed

Lines changed: 920 additions & 16 deletions

File tree

‎apps/web/package.json‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,18 @@
3737
"jose": "catalog:",
3838
"jsonc-parser": "3.3.1",
3939
"jszip": "3.10.1",
40+
"katex": "^0.16.47",
4041
"lexical": "^0.41.0",
4142
"lucide-react": "^0.564.0",
4243
"react": "19.2.6",
4344
"react-dom": "19.2.6",
4445
"react-markdown": "^10.1.0",
46+
"rehype-katex": "^7.0.1",
4547
"rehype-raw": "^7.0.0",
4648
"rehype-sanitize": "^6.0.0",
4749
"remark-breaks": "^4.0.0",
4850
"remark-gfm": "^4.0.1",
51+
"remark-math": "^6.0.0",
4952
"tailwind-merge": "^3.4.0",
5053
"zustand": "^5.0.11"
5154
},
@@ -58,14 +61,18 @@
5861
"@types/babel__core": "^7.20.5",
5962
"@types/compression": "^1.8.1",
6063
"@types/culori": "^4.0.1",
64+
"@types/hast": "^3.0.4",
65+
"@types/mdast": "^4.0.4",
6166
"@types/react": "~19.2.14",
6267
"@types/react-dom": "~19.2.3",
6368
"@vercel/config": "^0.3.0",
6469
"@vitejs/plugin-react": "^6.0.0",
6570
"babel-plugin-react-compiler": "1.0.0",
6671
"compression": "^1.8.1",
72+
"mdast-util-math": "^3.0.0",
6773
"msw": "2.12.11",
6874
"tailwindcss": "^4.0.0",
75+
"unified": "^11.0.5",
6976
"vite": "catalog:",
7077
"vite-plus": "catalog:"
7178
}

0 commit comments

Comments
 (0)