hotfix: Workflow page element warning problem #17787 (#17789)

This commit is contained in:
Jimmiaxie 2025-04-10 17:38:50 +08:00 committed by GitHub
parent 17a26da1e6
commit 605ab9e46c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -222,19 +222,21 @@ const Paragraph = (paragraph: any) => {
const children_node = node.children const children_node = node.children
if (children_node && children_node[0] && 'tagName' in children_node[0] && children_node[0].tagName === 'img') { if (children_node && children_node[0] && 'tagName' in children_node[0] && children_node[0].tagName === 'img') {
return ( return (
<> <div className="markdown-img-wrapper">
<ImageGallery srcs={[children_node[0].properties.src]} /> <ImageGallery srcs={[children_node[0].properties.src]} />
{ {
Array.isArray(paragraph.children) ? <p>{paragraph.children.slice(1)}</p> : null Array.isArray(paragraph.children) && paragraph.children.length > 1 && (
<div className="mt-2">{paragraph.children.slice(1)}</div>
)
} }
</> </div>
) )
} }
return <p>{paragraph.children}</p> return <p>{paragraph.children}</p>
} }
const Img = ({ src }: any) => { const Img = ({ src }: any) => {
return (<ImageGallery srcs={[src]} />) return <div className="markdown-img-wrapper"><ImageGallery srcs={[src]} /></div>
} }
const Link = ({ node, ...props }: any) => { const Link = ({ node, ...props }: any) => {