Skip to content

Commit

Permalink
Refactor Markdown component to include paragraph after image (#2798)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ag2S1 authored Mar 12, 2024
1 parent 6854a3f commit 870ca71
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions web/app/components/base/markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,17 @@ export function Markdown(props: { content: string; className?: string }) {
const image = node.children[0]

return (
// eslint-disable-next-line @next/next/no-img-element
<img
src={image.properties.src}
width={250}
height={250}
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}
/>
<>
{/* eslint-disable-next-line @next/next/no-img-element */}
<img
src={image.properties.src}
width={250}
height={250}
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}
/>
<p>{paragraph.children.slice(1)}</p>
</>
)
}
return <p>{paragraph.children}</p>
Expand Down

0 comments on commit 870ca71

Please sign in to comment.