Sfoglia il codice sorgente

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

tags/1.3.0
Jimmiaxie 6 mesi fa
parent
commit
605ab9e46c
Nessun account collegato all'indirizzo email del committer
1 ha cambiato i file con 6 aggiunte e 4 eliminazioni
  1. 6
    4
      web/app/components/base/markdown.tsx

+ 6
- 4
web/app/components/base/markdown.tsx Vedi File

@@ -222,19 +222,21 @@ const Paragraph = (paragraph: any) => {
const children_node = node.children
if (children_node && children_node[0] && 'tagName' in children_node[0] && children_node[0].tagName === 'img') {
return (
<>
<div className="markdown-img-wrapper">
<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>
}

const Img = ({ src }: any) => {
return (<ImageGallery srcs={[src]} />)
return <div className="markdown-img-wrapper"><ImageGallery srcs={[src]} /></div>
}

const Link = ({ node, ...props }: any) => {

Loading…
Annulla
Salva