UNPKG

myst-to-html

Version:
9 lines (7 loc) 327 B
import type { GenericParent } from 'myst-common'; import rehypeFormat from 'rehype-format'; import type { Plugin } from 'unified'; export const formatHtml: Plugin<[boolean?], string, GenericParent> = function formatHtml(opt) { if (!opt) return () => undefined; return rehypeFormat(typeof opt === 'boolean' ? {} : opt); };