react-markdown์ ์ฌ์ฉํ๋ฉด์ ์ด๋ฏธ์ง๋ฅผ ๋ ๋๋ง ํ๋ ๊ฒฝ์ฐ์ ํน๋ณํ ์ฒ๋ฆฌ๋ฅผ ํด์ฃผ์ง ์์ผ๋ฉด <p> ๋ด๋ถ์ <img />๋ฅผ ์ฌ์ฉํ๊ฒ ๋ฉ๋๋ค.
์ง์  ์คํํด ๋ณธ ๊ฒฐ๊ณผ๋ก๋ <p>ํ๊ทธ ๋ด๋ถ์๋ <a>์ <span>๊ฐ์ ํ๊ทธ ์ธ์ ๋ค๋ฅธ ํ๊ทธ๋ค์ด ๋ค์ด๊ฐ๋ฉด ๊ฒฝ๊ณ ๋ฅผ ๋์์ค๋๋ค.
๋ฐ๋ผ์ <img> react markdown cannot appear as a descendant of <p>. ๊ฐ์ ๊ฒฝ๊ณ ๊ฐ ๋ฐ์ํ๊ฒ ๋ฉ๋๋ค.
display๊ฐ inline์ธ ๊ฒฝ์ฐ์๋ ๋ด๋ถ์ ๋ค๋ฅธ ์์๋ฅผ ํฌํจํ  ์ ์์ต๋๋ค.display๊ฐ block์ธ ์์๋ง ๋ด๋ถ์ ๋ค๋ฅธ ์์๋ฅผ ํฌํจํ  ์ ์์ต๋๋ค.import ReactMarkdown from "react-markdown";
import remarkGfm from "remark-gfm";
// jsx
<ReactMarkdown
  className="py-4 px-8 prose dark:prose-invert whitespace-normal max-w-full"
  remarkPlugins={[remarkGfm]}
  components={{
    p: ({ node, ...props }) => {
      // <img />๋ฅผ ๋ ๋๋ง ํ๋ ๊ฒฝ์ฐ์ <p>๋ด๋ถ์์ ๋ ๋๋ง ๋์ง ์๋๋ก ํ๊ธฐ ์ํจ
      if (typeof props.children[0] === "object") {
        const element: any = props.children[0];
        return element.type.name === "img" ? (
          { ...element }
        ) : (
          <p {...props} />
        );
      }
      return <p {...props} className="whitespace-pre-line" />;
    },
	// ๋๋จธ์ง ๋ถ๋ถ ์๋ต...
  }}
>
  {markdown}
</ReactMarkdown>