| | |
| | | import { Components, toJsxRuntime } from "hast-util-to-jsx-runtime" |
| | | import { QuartzPluginData } from "../plugins/vfile" |
| | | import { Components, Jsx, toJsxRuntime } from "hast-util-to-jsx-runtime" |
| | | import { Node, Root } from "hast" |
| | | import { Fragment, jsx, jsxs } from "preact/jsx-runtime" |
| | | import { trace } from "./trace" |
| | |
| | | ), |
| | | } |
| | | |
| | | export function htmlToJsx(fp: FilePath, tree: Node<QuartzPluginData>) { |
| | | export function htmlToJsx(fp: FilePath, tree: Node) { |
| | | try { |
| | | // @ts-ignore (preact makes it angry) |
| | | return toJsxRuntime(tree as Root, { |
| | | Fragment, |
| | | jsx, |
| | | jsxs, |
| | | jsx: jsx as Jsx, |
| | | jsxs: jsxs as Jsx, |
| | | elementAttributeNameCase: "html", |
| | | components: customComponents, |
| | | }) |