feat: render assistant replies as markdown

Add react-markdown + remark-math + rehype-katex to render the AI's
markdown (headings, bold, lists, code, blockquotes, tables) and LaTeX
math ($H_2O$ etc.). ReactMarkdown escapes raw HTML, keeping the stored
message rendering safe from XSS. Styled via .markdown-body in Message.css.
Applied to assistant messages only; user text stays plain.
This commit is contained in:
2026-08-19 09:55:25 -04:00
parent 00a181134d
commit 56d6f355d1
4 changed files with 1640 additions and 7 deletions
+5 -1
View File
@@ -9,8 +9,12 @@
"preview": "vite preview"
},
"dependencies": {
"katex": "^0.18.4",
"react": "^19.0.0",
"react-dom": "^19.0.0"
"react-dom": "^19.0.0",
"react-markdown": "^10.1.0",
"rehype-katex": "^7.0.1",
"remark-math": "^6.0.0"
},
"devDependencies": {
"@vitejs/plugin-react": "^4.3.4",