Browse Source

feat: import ramarkBreaks plugin

RugerMc 1 year ago
parent
commit
2c5420ab9e
2 changed files with 3 additions and 1 deletions
  1. 2 1
      app/components/markdown.tsx
  2. 1 0
      package.json

+ 2 - 1
app/components/markdown.tsx

@@ -1,6 +1,7 @@
 import ReactMarkdown from "react-markdown";
 import "katex/dist/katex.min.css";
 import RemarkMath from "remark-math";
+import RemarkBreaks from "remark-breaks";
 import RehypeKatex from "rehype-katex";
 import RemarkGfm from "remark-gfm";
 import RehypePrsim from "rehype-prism-plus";
@@ -29,7 +30,7 @@ export function PreCode(props: { children: any }) {
 export function Markdown(props: { content: string }) {
   return (
     <ReactMarkdown
-      remarkPlugins={[RemarkMath, RemarkGfm]}
+      remarkPlugins={[RemarkMath, RemarkGfm, RemarkBreaks]}
       rehypePlugins={[RehypeKatex, [RehypePrsim, { ignoreMissing: true }]]}
       components={{
         pre: PreCode,

+ 1 - 0
package.json

@@ -23,6 +23,7 @@
     "react": "^18.2.0",
     "react-dom": "^18.2.0",
     "react-markdown": "^8.0.5",
+    "remark-breaks": "^3.0.2",
     "rehype-katex": "^6.0.2",
     "rehype-prism-plus": "^1.5.1",
     "remark-gfm": "^3.0.1",