Skip to content

pantoken-root / renderers/react-markdown/src / rehypeColorCodes

Funzione: rehypeColorCodes() ​

rehypeColorCodes(): (tree) => void

Beta

Un plugin rehype che avvolge i valori colore indipendenti in <span data-color-code="…">, in modo che il livello React possa renderizzare un campione di colore. Rispecchia la pipeline icon-token.

Restituisce ​

(tree) => void

Esempio ​

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

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