Prechádzať zdrojové kódy

fix: page broke down while rendering node contained img and other elements (#14467)

NFish 1 mesiac pred
rodič
commit
ddf9eb1f9a
1 zmenil súbory, kde vykonal 3 pridanie a 1 odobranie
  1. 3 1
      web/app/components/base/markdown.tsx

+ 3 - 1
web/app/components/base/markdown.tsx

@@ -211,7 +211,9 @@ const Paragraph = (paragraph: any) => {
     return (
       <>
         <ImageGallery srcs={[children_node[0].properties.src]} />
-        <p>{paragraph.children.slice(1)}</p>
+        {
+          Array.isArray(paragraph.children) ? <p>{paragraph.children.slice(1)}</p> : null
+        }
       </>
     )
   }