Skip to content

pantoken / renderers/react-markdown/src / rehypeGithubAlerts

Funksjon: rehypeGithubAlerts()

rehypeGithubAlerts(): (tree) => void

Beta

Ein rehype-plugin som merkjer GitHub-varsel-sitatblokker: den oppdagar ein [!NOTE]-stil markør i byrjinga av eit sitat, lagrar han som data-alert="note" og fjernar markørteksten. The React blockquote component then renders an InstUI Alert.

Returnerer

(tree) => void

Døme

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

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