From 9c8fec06d2b58e4e3bbe280ddc665a99fcc4878c Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Sun, 09 Mar 2025 22:33:15 +0000
Subject: [PATCH] feat: support non-singleton search

---
 quartz/components/pages/Content.tsx |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/quartz/components/pages/Content.tsx b/quartz/components/pages/Content.tsx
index d233845..e21aad7 100644
--- a/quartz/components/pages/Content.tsx
+++ b/quartz/components/pages/Content.tsx
@@ -1,11 +1,12 @@
-import { QuartzComponentConstructor, QuartzComponentProps } from "../types"
-import { Fragment, jsx, jsxs } from 'preact/jsx-runtime'
-import { toJsxRuntime } from "hast-util-to-jsx-runtime"
+import { ComponentChildren } from "preact"
+import { htmlToJsx } from "../../util/jsx"
+import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "../types"
 
-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>
+const Content: QuartzComponent = ({ fileData, tree }: QuartzComponentProps) => {
+  const content = htmlToJsx(fileData.filePath!, tree) as ComponentChildren
+  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