import { MarkdownItHeader } from '@mdit-vue/types'; import { RuleBlock } from 'markdown-it/lib/parser_block.mjs'; import { PluginWithOptions } from 'markdown-it'; /** * Options of @mdit-vue/plugin-toc */ interface TocPluginOptions { /** * The pattern serving as the TOC placeholder in your markdown * * @default /^\[\[toc\]\]$/i */ pattern?: RegExp; /** * A custom slugification function * * Should use the same slugify function with markdown-it-anchor * to ensure the link is matched */ slugify?: (str: string) => string; /** * A function for formatting headings */ format?: (str: string) => string; /** * Heading level that going to be included in the TOC * * Should be a subset of markdown-it-anchor's `level` option * to ensure the link is existed * * @default [2,3] */ level?: number[]; /** * Should allow headers inside nested blocks or not * * If set to `true`, headers inside blockquote, list, etc. would also be included. * * @default false */ shouldAllowNested?: boolean; /** * HTML tag of the TOC container * * @default 'nav' */ containerTag?: string; /** * The class for the TOC container * * @default 'table-of-contents' */ containerClass?: string; /** * HTML tag of the TOC list * * @default 'ul' */ listTag?: 'ol' | 'ul'; /** * The class for the TOC list * * @default '' */ listClass?: string; /** * The class for the `