Skip to content

pantoken / renderers/react-markdown/src / rehypeGithubAlerts

Swyddogaeth: rehypeGithubAlerts()

rehypeGithubAlerts(): (tree) => void

Bêta

Plugin rehype sy'n tagio dyfyniadau bloc rhybudd GitHub: mae'n canfod marcyn ar ffurf [!NOTE] ar ddechrau dyfyniad bloc, yn ei gofnodi fel data-alert="note", ac yn tynnu testun y marcyn. Y cydran React blockquote wedyn yn rendro Alert o InstUI.

Yn dychwelyd

(tree) => void

Enghraifft

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

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