Merge pull request #5377 from ConnectAI-E/hotfix/mermaid

hotfix Mermaid can not render. close #5374
This commit is contained in:
Lloyd Zhou 2024-09-07 13:01:36 +08:00 committed by GitHub
commit 116a73d398
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -163,7 +163,7 @@ export function PreCode(props: { children: any }) {
);
}
function CustomCode(props: { children: any }) {
function CustomCode(props: { children: any; className?: string }) {
const ref = useRef<HTMLPreElement>(null);
const [collapsed, setCollapsed] = useState(true);
const [showToggle, setShowToggle] = useState(false);
@ -182,6 +182,7 @@ function CustomCode(props: { children: any }) {
return (
<>
<code
className={props?.className}
ref={ref}
style={{
maxHeight: collapsed ? "400px" : "none",