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.
24 lines
468 B
JSON
24 lines
468 B
JSON
{
|
|
"name": "padhle-frontend",
|
|
"private": true,
|
|
"version": "0.1.0",
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "vite",
|
|
"build": "vite build",
|
|
"preview": "vite preview"
|
|
},
|
|
"dependencies": {
|
|
"katex": "^0.18.4",
|
|
"react": "^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",
|
|
"vite": "^6.0.0"
|
|
}
|
|
}
|