소스 검색

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

tags/0.5.10
Yulong Wang 1 년 전
부모
커밋
870ca713df
No account linked to committer's email address
1개의 변경된 파일11개의 추가작업 그리고 8개의 파일을 삭제
  1. 11
    8
      web/app/components/base/markdown.tsx

+ 11
- 8
web/app/components/base/markdown.tsx 파일 보기

const image = node.children[0] const image = node.children[0]


return ( 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> return <p>{paragraph.children}</p>

Loading…
취소
저장