fix: fix overflow for lists in markdown render (#4720)
* feat: Add support for ordered and unordered lists in ContentDisplay and ChatMessage components to prevent overflow
This commit is contained in:
parent
f1c00750aa
commit
39cec36641
2 changed files with 20 additions and 0 deletions
|
|
@ -155,6 +155,12 @@ export default function ContentDisplay({
|
|||
pre({ node, ...props }) {
|
||||
return <>{props.children}</>;
|
||||
},
|
||||
ol({ node, ...props }) {
|
||||
return <ol className="max-w-full">{props.children}</ol>;
|
||||
},
|
||||
ul({ node, ...props }) {
|
||||
return <ul className="max-w-full">{props.children}</ul>;
|
||||
},
|
||||
code: ({ node, inline, className, children, ...props }) => {
|
||||
const match = /language-(\w+)/.exec(className || "");
|
||||
return !inline ? (
|
||||
|
|
|
|||
|
|
@ -552,6 +552,20 @@ export default function ChatMessage({
|
|||
</span>
|
||||
);
|
||||
},
|
||||
ol({ node, ...props }) {
|
||||
return (
|
||||
<ol className="max-w-full">
|
||||
{props.children}
|
||||
</ol>
|
||||
);
|
||||
},
|
||||
ul({ node, ...props }) {
|
||||
return (
|
||||
<ul className="max-w-full">
|
||||
{props.children}
|
||||
</ul>
|
||||
);
|
||||
},
|
||||
pre({ node, ...props }) {
|
||||
return <>{props.children}</>;
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue