mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-20 04:42:46 +08:00
hotfix Mermaid can not render. close #5374
This commit is contained in:
@@ -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 ref = useRef<HTMLPreElement>(null);
|
||||||
const [collapsed, setCollapsed] = useState(true);
|
const [collapsed, setCollapsed] = useState(true);
|
||||||
const [showToggle, setShowToggle] = useState(false);
|
const [showToggle, setShowToggle] = useState(false);
|
||||||
@@ -182,6 +182,7 @@ function CustomCode(props: { children: any }) {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<code
|
<code
|
||||||
|
className={props?.className}
|
||||||
ref={ref}
|
ref={ref}
|
||||||
style={{
|
style={{
|
||||||
maxHeight: collapsed ? "400px" : "none",
|
maxHeight: collapsed ? "400px" : "none",
|
||||||
|
Reference in New Issue
Block a user