Skip to content

pantoken / renderers/react-markdown/src / rehypeGithubAlerts

Feidhm: rehypeGithubAlerts()

rehypeGithubAlerts(): (tree) => void

Béite

Plugin rehype a lipéadaíonn luacháin bhloic rabhaidh GitHub: braitheann sé marcóir ar stíl [!NOTE] ag tús luacháin bhloic, taifeadann sé é mar data-alert="note", agus baintear téacs an mharcóra. Anois léiríonn an chomhpháirt React blockquote InstUI Alert.

Tuairisceáin

(tree) => void

Sampla

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

<Markdown rehypePlugins={[rehypeGithubAlerts]}>{"> [!NOTE]\n> Heads up."}</Markdown>;