Skip to content

pantoken / renderers/react-markdown/src / rehypeGithubAlerts

Funzione: rehypeGithubAlerts()

rehypeGithubAlerts(): (tree) => void

Beta

Un plugin rehype che etichetta i blockquote di avviso di GitHub: rileva un marcatore in stile [!NOTE] all'inizio di un blockquote, lo registra come data-alert="note" e rimuove il testo del marcatore. Il componente React blockquote quindi renderizza un Alert di InstUI.

Restituisce

(tree) => void

Esempio

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

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