Skip to content

pantoken / renderers/react-markdown/src / rehypeColorCodes

Funktion: rehypeColorCodes()

rehypeColorCodes(): (tree) => void

Beta

Ett rehype-plugin som omsluter fristående färgvärden i <span data-color-code="…">, så att React lagret kan rendera ett färgprov. Motsvarar icon-token-pipelinen.

Returnerar

(tree) => void

Exempel

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

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