From 50bb1ffd8aa00d85d3a17bc1a4e52d26187afa7e Mon Sep 17 00:00:00 2001
From: Aaron Pham <29749331+aarnphm@users.noreply.github.com>
Date: Wed, 31 Jan 2024 17:38:42 +0000
Subject: [PATCH] feat(usability): update functions for search (#774)
---
quartz/components/pages/Content.tsx | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/quartz/components/pages/Content.tsx b/quartz/components/pages/Content.tsx
index d233845..2e6416f 100644
--- a/quartz/components/pages/Content.tsx
+++ b/quartz/components/pages/Content.tsx
@@ -1,11 +1,11 @@
+import { htmlToJsx } from "../../util/jsx"
import { QuartzComponentConstructor, QuartzComponentProps } from "../types"
-import { Fragment, jsx, jsxs } from 'preact/jsx-runtime'
-import { toJsxRuntime } from "hast-util-to-jsx-runtime"
-function Content({ tree }: QuartzComponentProps) {
- // @ts-ignore (preact makes it angry)
- const content = toJsxRuntime(tree, { Fragment, jsx, jsxs, elementAttributeNameCase: 'html' })
- return <article class="popover-hint">{content}</article>
+function Content({ fileData, tree }: QuartzComponentProps) {
+ const content = htmlToJsx(fileData.filePath!, tree)
+ const classes: string[] = fileData.frontmatter?.cssclasses ?? []
+ const classString = ["popover-hint", ...classes].join(" ")
+ return <article class={classString}>{content}</article>
}
export default (() => Content) satisfies QuartzComponentConstructor
--
Gitblit v1.10.0