From ef72f1bf707dca363cdab84da91e2acfaef8f276 Mon Sep 17 00:00:00 2001
From: Ammar Alakkad <am.alakkad@gmail.com>
Date: Mon, 30 Dec 2024 16:03:57 +0000
Subject: [PATCH] Fix ObsidianFlavoredMarkdown source link (#1694)
---
quartz/components/pages/Content.tsx | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/quartz/components/pages/Content.tsx b/quartz/components/pages/Content.tsx
index d233845..8222d78 100644
--- a/quartz/components/pages/Content.tsx
+++ b/quartz/components/pages/Content.tsx
@@ -1,11 +1,11 @@
-import { QuartzComponentConstructor, QuartzComponentProps } from "../types"
-import { Fragment, jsx, jsxs } from 'preact/jsx-runtime'
-import { toJsxRuntime } from "hast-util-to-jsx-runtime"
+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)
+ 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