diff --git a/quartz/components/pages/Content.tsx b/quartz/components/pages/Content.tsx index 8222d786e..e21aad7ec 100644 --- a/quartz/components/pages/Content.tsx +++ b/quartz/components/pages/Content.tsx @@ -1,8 +1,9 @@ +import { ComponentChildren } from "preact" import { htmlToJsx } from "../../util/jsx" import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "../types" const Content: QuartzComponent = ({ fileData, tree }: QuartzComponentProps) => { - const content = htmlToJsx(fileData.filePath!, tree) + const content = htmlToJsx(fileData.filePath!, tree) as ComponentChildren const classes: string[] = fileData.frontmatter?.cssclasses ?? [] const classString = ["popover-hint", ...classes].join(" ") return
{content}
diff --git a/quartz/components/pages/FolderContent.tsx b/quartz/components/pages/FolderContent.tsx index 593073b96..977da5e9c 100644 --- a/quartz/components/pages/FolderContent.tsx +++ b/quartz/components/pages/FolderContent.tsx @@ -8,6 +8,7 @@ import { Root } from "hast" import { htmlToJsx } from "../../util/jsx" import { i18n } from "../../i18n" import { QuartzPluginData } from "../../plugins/vfile" +import { ComponentChildren } from "preact" interface FolderContentOptions { /** @@ -78,10 +79,11 @@ export default ((opts?: Partial) => { allFiles: allPagesInFolder, } - const content = + const content = ( (tree as Root).children.length === 0 ? fileData.description : htmlToJsx(fileData.filePath!, tree) + ) as ComponentChildren return (
diff --git a/quartz/components/pages/TagContent.tsx b/quartz/components/pages/TagContent.tsx index e56c6d609..087daf18a 100644 --- a/quartz/components/pages/TagContent.tsx +++ b/quartz/components/pages/TagContent.tsx @@ -6,6 +6,7 @@ import { QuartzPluginData } from "../../plugins/vfile" import { Root } from "hast" import { htmlToJsx } from "../../util/jsx" import { i18n } from "../../i18n" +import { ComponentChildren } from "preact" interface TagContentOptions { sort?: SortFn @@ -33,10 +34,11 @@ export default ((opts?: Partial) => { (file.frontmatter?.tags ?? []).flatMap(getAllSegmentPrefixes).includes(tag), ) - const content = + const content = ( (tree as Root).children.length === 0 ? fileData.description : htmlToJsx(fileData.filePath!, tree) + ) as ComponentChildren const cssClasses: string[] = fileData.frontmatter?.cssclasses ?? [] const classes = cssClasses.join(" ") if (tag === "/") {