chore(build): separate markdown and html handling into two separate stages (#1675)

This commit is contained in:
Anton Bulakh
2025-01-07 22:33:34 +02:00
committed by GitHub
parent b7a945e034
commit c90dbacab0
4 changed files with 103 additions and 37 deletions

View File

@ -1,11 +1,13 @@
import { Node, Parent } from "hast"
import { Root as HtmlRoot } from "hast"
import { Root as MdRoot } from "mdast"
import { Data, VFile } from "vfile"
export type QuartzPluginData = Data
export type ProcessedContent = [Node, VFile]
export type MarkdownContent = [MdRoot, VFile]
export type ProcessedContent = [HtmlRoot, VFile]
export function defaultProcessedContent(vfileData: Partial<QuartzPluginData>): ProcessedContent {
const root: Parent = { type: "root", children: [] }
const root: HtmlRoot = { type: "root", children: [] }
const vfile = new VFile("")
vfile.data = vfileData
return [root, vfile]