mirror of https://github.com/vuejs/vitepress
Drop-in for our usage: identical defaults (min-level semantics, tabindex, unique slug handling) and the same permalink/getTokensText signatures, with proper ESM types - removing the type patch we carried for markdown-it-anchor. BREAKING CHANGE: `markdown.anchor` options are now typed by `@mdit/plugin-anchor`. Common options (`level`, `slugify`, `permalink`, `getTokensText`, `tabIndex`, etc.) are unchanged, but the deprecated markdown-it-anchor permalink options (`permalinkSymbol`, `renderPermalink`, ...) are no longer accepted. Permalink builders like `headerLink` are named exports of `@mdit/plugin-anchor` instead of properties of the plugin. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>pull/5335/head
parent
3514d82617
commit
7550517916
@ -1,17 +0,0 @@
|
|||||||
diff --git a/types/index.d.ts b/types/index.d.ts
|
|
||||||
index 40c25c0be1add8b0fc2c51489c25a423dbc49d2c..807bc1b0e434d660c6a298b1dee1c87935bfac86 100644
|
|
||||||
--- a/types/index.d.ts
|
|
||||||
+++ b/types/index.d.ts
|
|
||||||
@@ -1,10 +1,8 @@
|
|
||||||
import MarkdownIt from 'markdown-it';
|
|
||||||
-import { default as MarkdownItToken } from 'markdown-it/lib/token.mjs';
|
|
||||||
-import { default as MarkdownItState} from 'markdown-it/lib/rules_core/state_core.mjs';
|
|
||||||
+import { default as Token } from 'markdown-it/lib/token.mjs';
|
|
||||||
+import { default as State } from 'markdown-it/lib/rules_core/state_core.mjs';
|
|
||||||
|
|
||||||
declare namespace anchor {
|
|
||||||
- export type Token = MarkdownItToken
|
|
||||||
- export type State = MarkdownItState
|
|
||||||
export type RenderHref = (slug: string, state: State) => string;
|
|
||||||
export type RenderAttrs = (slug: string, state: State) => Record<string, string | number>;
|
|
||||||
|
|
||||||
Loading…
Reference in new issue