Skip to content

pantoken / renderers/react-markdown/src / rehypeColorCodes

פונקציה: rehypeColorCodes()

rehypeColorCodes(): (tree) => void

בטא

תוסף rehype שעוטף ערכי צבע בודדים בתוך <span data-color-code="…">, כדי ששכבת React תוכל להציג מדגם צבע. משקף את צינור ה-pipeline של icon-token.

מחזיר

(tree) => void

דוגמה

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

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