Parcourir la source

hotfix Mermaid can not render. close #5374

lloydzhou il y a 1 an
Parent
commit
cf0c057164
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 2 1
      app/components/markdown.tsx

+ 2 - 1
app/components/markdown.tsx

@@ -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",