feat: use image component in entry content

This commit is contained in:
DIYgod 2024-06-02 19:18:30 +08:00
parent 36a2dc14eb
commit c7dba2b4d6
No known key found for this signature in database
1 changed files with 4 additions and 0 deletions

View File

@ -1,3 +1,4 @@
import { Image } from "@renderer/components/ui/image"
import { toJsxRuntime } from "hast-util-to-jsx-runtime"
import { Fragment, jsx, jsxs } from "react/jsx-runtime"
import rehypeInferDescriptionMeta from "rehype-infer-description-meta"
@ -49,6 +50,9 @@ export const parseHtml = async (content: string) => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
jsxs: (type, props, key) => jsxs(type as any, props, key),
passNode: true,
components: {
img: Image,
},
}),
}
}