fix(webui): preserve single newlines in markdown rendering
Add remark-breaks plugin so that single newlines in assistant messages (such as /help output) render as line breaks instead of being collapsed into a single paragraph by standard markdown behavior.
This commit is contained in:
@@ -2,6 +2,7 @@ import { Children, isValidElement, useMemo } from "react";
|
||||
import type { Components } from "react-markdown";
|
||||
import ReactMarkdown from "react-markdown";
|
||||
import rehypeKatex from "rehype-katex";
|
||||
import remarkBreaks from "remark-breaks";
|
||||
import remarkGfm from "remark-gfm";
|
||||
import remarkMath from "remark-math";
|
||||
|
||||
@@ -17,7 +18,7 @@ interface MarkdownTextRendererProps {
|
||||
highlightCode?: boolean;
|
||||
}
|
||||
|
||||
const remarkPlugins = [remarkGfm, remarkMath];
|
||||
const remarkPlugins = [remarkBreaks, remarkGfm, remarkMath];
|
||||
const rehypePlugins = [rehypeKatex];
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user