mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-06-30 09:45:11 +08:00
### 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)
This commit is contained in:
parent
9ce6521582
commit
724a36fcdb
@ -201,11 +201,16 @@ const MarkdownContent = ({
|
|||||||
const { children, className, node, ...rest } = props;
|
const { children, className, node, ...rest } = props;
|
||||||
const match = /language-(\w+)/.exec(className || '');
|
const match = /language-(\w+)/.exec(className || '');
|
||||||
return match ? (
|
return match ? (
|
||||||
<SyntaxHighlighter {...rest} PreTag="div" language={match[1]}>
|
<SyntaxHighlighter
|
||||||
|
{...rest}
|
||||||
|
PreTag="div"
|
||||||
|
language={match[1]}
|
||||||
|
wrapLongLines
|
||||||
|
>
|
||||||
{String(children).replace(/\n$/, '')}
|
{String(children).replace(/\n$/, '')}
|
||||||
</SyntaxHighlighter>
|
</SyntaxHighlighter>
|
||||||
) : (
|
) : (
|
||||||
<code {...rest} className={className}>
|
<code {...rest} className={classNames(className, 'text-wrap')}>
|
||||||
{children}
|
{children}
|
||||||
</code>
|
</code>
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user