From 14ad5640f4484cbd1191c8407fe6fc8e4b36fc7e Mon Sep 17 00:00:00 2001 From: josc146 Date: Mon, 20 Mar 2023 15:39:07 +0800 Subject: [PATCH] fix: words get cut off (#30, #35) --- package-lock.json | 11 +++++++++++ package.json | 1 + .../MarkdownRender/markdown-without-katex.jsx | 3 ++- src/components/MarkdownRender/markdown.jsx | 3 ++- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6cb6ec7..af87706 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,6 +29,7 @@ "rehype-highlight": "^6.0.0", "rehype-katex": "^6.0.2", "rehype-raw": "^6.1.1", + "remark-breaks": "^3.0.2", "remark-gfm": "^3.0.1", "remark-math": "^5.1.1", "uuid": "^9.0.0", @@ -7824,6 +7825,16 @@ "unified": "^10.0.0" } }, + "node_modules/remark-breaks": { + "version": "3.0.2", + "resolved": "https://registry.npmmirror.com/remark-breaks/-/remark-breaks-3.0.2.tgz", + "integrity": "sha512-x96YDJ9X+Ry0/JNZFKfr1hpcAKvGYWfUTszxY9RbxKEqq6uzPPoLCuHdZsLPZZUdAv3nCROyc7FPrQLWr2rxyw==", + "dependencies": { + "@types/mdast": "^3.0.0", + "unified": "^10.0.0", + "unist-util-visit": "^4.0.0" + } + }, "node_modules/remark-gfm": { "version": "3.0.1", "resolved": "https://registry.npmmirror.com/remark-gfm/-/remark-gfm-3.0.1.tgz", diff --git a/package.json b/package.json index fddfb44..750a3c8 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "rehype-highlight": "^6.0.0", "rehype-katex": "^6.0.2", "rehype-raw": "^6.1.1", + "remark-breaks": "^3.0.2", "remark-gfm": "^3.0.1", "remark-math": "^5.1.1", "uuid": "^9.0.0", diff --git a/src/components/MarkdownRender/markdown-without-katex.jsx b/src/components/MarkdownRender/markdown-without-katex.jsx index 046bc55..350ba8d 100644 --- a/src/components/MarkdownRender/markdown-without-katex.jsx +++ b/src/components/MarkdownRender/markdown-without-katex.jsx @@ -2,6 +2,7 @@ import ReactMarkdown from 'react-markdown' import rehypeRaw from 'rehype-raw' import rehypeHighlight from 'rehype-highlight' import remarkGfm from 'remark-gfm' +import remarkBreaks from 'remark-breaks' import CopyButton from '../CopyButton' import { useRef } from 'react' import PropTypes from 'prop-types' @@ -34,7 +35,7 @@ export function MarkdownRender(props) { return (