Skip to content

pantoken / renderers/react-markdown/src / rehypeColorCodes

함수: rehypeColorCodes()

rehypeColorCodes(): (tree) => void

베타

단독 색상 값을 <span data-color-code="…">로 감싸는 rehype 플러그인으로, React layer가 스와치를 렌더링할 수 있도록 합니다. 아이콘-토큰 파이프라인을 반영합니다.

반환값

(tree) => void

예제

tsx
import Markdown from "react-markdown";
import { rehypeColorCodes } from "@pantoken/react-markdown";

<Markdown rehypePlugins={[rehypeColorCodes]}>Brand is #03893D.</Markdown>;