import Markdown, { Components } from "react-markdown"; import remarkGfm from "remark-gfm"; import remarkBreaks from "remark-breaks"; import rehypeRaw from "rehype-raw"; import rehypeSanitize, { defaultSchema } from "rehype-sanitize"; import type { Schema } from "hast-util-sanitize"; import type { PluggableList } from "unified"; import { code } from "./code"; import { ul, ol, li } from "./list"; import { paragraph } from "./paragraph"; import { anchor } from "./anchor"; import { h1, h2, h3, h4, h5, h6 } from "./headings"; import { table, th, td } from "./table"; import { blockquote } from "./blockquote"; import { hr } from "./horizontal-rule"; import { remarkGithubAlerts } from "./remark-github-alerts"; // Build a sanitize schema that extends rehype-sanitize's defaults with a // few markdown-friendly additions. The defaults strip `