瀏覽代碼

Fix: Issue with Markdown Code Blocks Breaking Frontend Layout #5789 (#6758)

### What problem does this PR solve?

Fix: Issue with Markdown Code Blocks Breaking Frontend Layout #5789

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
tags/v0.18.0
balibabu 7 月之前
父節點
當前提交
724a36fcdb
No account linked to committer's email address
共有 1 個文件被更改,包括 7 次插入2 次删除
  1. 7
    2
      web/src/pages/chat/markdown-content/index.tsx

+ 7
- 2
web/src/pages/chat/markdown-content/index.tsx 查看文件

@@ -201,11 +201,16 @@ const MarkdownContent = ({
const { children, className, node, ...rest } = props;
const match = /language-(\w+)/.exec(className || '');
return match ? (
<SyntaxHighlighter {...rest} PreTag="div" language={match[1]}>
<SyntaxHighlighter
{...rest}
PreTag="div"
language={match[1]}
wrapLongLines
>
{String(children).replace(/\n$/, '')}
</SyntaxHighlighter>
) : (
<code {...rest} className={className}>
<code {...rest} className={classNames(className, 'text-wrap')}>
{children}
</code>
);

Loading…
取消
儲存