Unverified Commit 870ca713 authored by Yulong Wang's avatar Yulong Wang Committed by GitHub

Refactor Markdown component to include paragraph after image (#2798)

parent 6854a3fd
...@@ -162,7 +162,8 @@ export function Markdown(props: { content: string; className?: string }) { ...@@ -162,7 +162,8 @@ export function Markdown(props: { content: string; className?: string }) {
const image = node.children[0] const image = node.children[0]
return ( return (
// eslint-disable-next-line @next/next/no-img-element <>
{/* eslint-disable-next-line @next/next/no-img-element */}
<img <img
src={image.properties.src} src={image.properties.src}
width={250} width={250}
...@@ -170,6 +171,8 @@ export function Markdown(props: { content: string; className?: string }) { ...@@ -170,6 +171,8 @@ export function Markdown(props: { content: string; className?: string }) {
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" 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"
alt={image.properties.alt} alt={image.properties.alt}
/> />
<p>{paragraph.children.slice(1)}</p>
</>
) )
} }
return <p>{paragraph.children}</p> return <p>{paragraph.children}</p>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment