Skip to content

pantoken / renderers/react-markdown/src / rehypeColorCodes

Fonksiyon: rehypeColorCodes()

rehypeColorCodes(): (tree) => void

Beta

Tek başına renk değerlerini <span data-color-code="…"> içinde sarıp, React katmanının bir renk örneğini render etmesini sağlayan bir rehype eklentisi. Mirrors the icon-token pipeline.

Döndürür

(tree) => void

Örnek

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

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