Skip to content

Commit 870ca71

Browse files
authored
Refactor Markdown component to include paragraph after image (langgenius#2798)
1 parent 6854a3f commit 870ca71

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

web/app/components/base/markdown.tsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,17 @@ export function Markdown(props: { content: string; className?: string }) {
162162
const image = node.children[0]
163163

164164
return (
165-
// eslint-disable-next-line @next/next/no-img-element
166-
<img
167-
src={image.properties.src}
168-
width={250}
169-
height={250}
170-
className="max-w-full h-auto align-middle border-none rounded-lg shadow-md hover:shadow-lg transition-shadow duration-300 ease-in-out mt-2 mb-2"
171-
alt={image.properties.alt}
172-
/>
165+
<>
166+
{/* eslint-disable-next-line @next/next/no-img-element */}
167+
<img
168+
src={image.properties.src}
169+
width={250}
170+
height={250}
171+
className="max-w-full h-auto align-middle border-none rounded-lg shadow-md hover:shadow-lg transition-shadow duration-300 ease-in-out mt-2 mb-2"
172+
alt={image.properties.alt}
173+
/>
174+
<p>{paragraph.children.slice(1)}</p>
175+
</>
173176
)
174177
}
175178
return <p>{paragraph.children}</p>

0 commit comments

Comments
 (0)