| | |
| | | import { QuartzTransformerPlugin } from "../types" |
| | | import { Root, Html, BlockContent, DefinitionContent, Code, Paragraph } from "mdast" |
| | | import { Root, Html, BlockContent, DefinitionContent, Paragraph, Code } from "mdast" |
| | | import { Element, Literal, Root as HtmlRoot } from "hast" |
| | | import { ReplaceFunction, findAndReplace as mdastFindReplace } from "mdast-util-find-and-replace" |
| | | import { slug as slugAnchor } from "github-slugger" |
| | |
| | | }, |
| | | htmlPlugins() { |
| | | const plugins: PluggableList = [rehypeRaw] |
| | | |
| | | if (opts.parseBlockReferences) { |
| | | plugins.push(() => { |
| | | const inlineTagTypes = new Set(["p", "li"]) |
| | | const blockTagTypes = new Set(["blockquote"]) |
| | | return (tree, file) => { |
| | | return (tree: HtmlRoot, file) => { |
| | | file.data.blocks = {} |
| | | |
| | | visit(tree, "element", (node, index, parent) => { |