pantoken / renderers/react-markdown/src / rehypeGithubAlerts
Function: rehypeGithubAlerts()
rehypeGithubAlerts(): (
tree) =>void
Beta
A rehype plugin that tags GitHub-alert blockquotes: it detects a [!NOTE]-style marker at the start of a blockquote, records it as data-alert="note", and strips the marker text. The React blockquote component then renders an InstUI Alert.
Returns
(tree) => void
Example
tsx
import Markdown from "react-markdown";
import { rehypeGithubAlerts } from "@pantoken/react-markdown";
<Markdown rehypePlugins={[rehypeGithubAlerts]}>{"> [!NOTE]\n> Heads up."}</Markdown>;