import { unified } from "unified"; import rehypeParse from "rehype-parse"; import rehypeRemark from "rehype-remark"; import remarkStringify from "remark-stringify"; import remarkGfm from "remark-gfm"; export function h2mSync(html: string) { const file = unified() .use(rehypeParse) .use(rehypeRemark) .use(remarkGfm) .use(remarkStringify) .processSync(html); return String(file); }