fix: calculate heading after latex (closes #719)
| | |
| | | plugins: { |
| | | transformers: [ |
| | | Plugin.FrontMatter(), |
| | | Plugin.TableOfContents(), |
| | | Plugin.CreatedModifiedDate({ |
| | | // you can add 'git' here for last modified from Git |
| | | // if you do rely on git for dates, ensure defaultDateType is 'modified' |
| | |
| | | Plugin.SyntaxHighlighting(), |
| | | Plugin.ObsidianFlavoredMarkdown({ enableInHtmlEmbed: false }), |
| | | Plugin.GitHubFlavoredMarkdown(), |
| | | Plugin.TableOfContents(), |
| | | Plugin.CrawlLinks({ markdownLinkResolution: "shortest" }), |
| | | Plugin.Description(), |
| | | ], |
| | |
| | | } |
| | | |
| | | const regexMdLinks = new RegExp(/\[([^\[]+)\](\(.*\))/, "g") |
| | | const slugAnchor = new Slugger() |
| | | export const TableOfContents: QuartzTransformerPlugin<Partial<Options> | undefined> = ( |
| | | userOpts, |
| | | ) => { |
| | |
| | | return async (tree: Root, file) => { |
| | | const display = file.data.frontmatter?.enableToc ?? opts.showByDefault |
| | | if (display) { |
| | | const slugAnchor = new Slugger() |
| | | slugAnchor.reset() |
| | | const toc: TocEntry[] = [] |
| | | let highestDepth: number = opts.maxDepth |
| | | visit(tree, "heading", (node) => { |