Skip to content

pantoken / renderers/react-markdown/src / rehypeColorCodes

Συνάρτηση: rehypeColorCodes()

rehypeColorCodes(): (tree) => void

Βήτα

Ένα plugin rehype που περιβάλλει αυτόνομες τιμές χρώματος σε <span data-color-code="…">, ώστε το React στρώμα να μπορεί να αποδώσει ένα δείγμα χρώματος. Αντικατοπτρίζει την icon-token pipeline.

Επιστρέφει

(tree) => void

Παράδειγμα

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

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