From 0a3379a8530f365e2bd85e8ea20a1dfc8126c39c Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Fri, 02 Feb 2024 18:10:25 +0000
Subject: [PATCH] fix(search): null checks and focus fixes
---
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