Skip to content

Commit 4941b92

Browse files
committed
Render line breaks in our markdown block
1 parent 7cd6520 commit 4941b92

File tree

3 files changed

+25
-16
lines changed

3 files changed

+25
-16
lines changed

pnpm-lock.yaml

Lines changed: 22 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
"react-virtuoso": "^4.7.13",
6363
"rehype-highlight": "^7.0.0",
6464
"rehype-katex": "^7.0.1",
65+
"remark-breaks": "^4.0.0",
6566
"remark-gfm": "^4.0.1",
6667
"remark-math": "^6.0.0",
6768
"remove-markdown": "^0.6.0",

webview-ui/src/components/common/MarkdownBlock.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { visit } from "unist-util-visit"
55
import rehypeKatex from "rehype-katex"
66
import remarkMath from "remark-math"
77
import remarkGfm from "remark-gfm"
8+
import remarkBreaks from "remark-breaks"
89

910
import { vscode } from "@src/utils/vscode"
1011

@@ -289,6 +290,7 @@ const MarkdownBlock = memo(({ markdown }: MarkdownBlockProps) => {
289290
remarkPlugins={[
290291
remarkGfm,
291292
remarkMath,
293+
remarkBreaks,
292294
() => {
293295
return (tree: any) => {
294296
visit(tree, "code", (node: any) => {

0 commit comments

Comments
 (0)