-
Notifications
You must be signed in to change notification settings - Fork 185
Closed
Labels
bugIssue raised as a bug.Issue raised as a bug.
Description
What package is the bug related to?
typedoc-vitepress-theme
Describe the issue
For example, I have an object property named "build:before", the anchor generated by typedoc is "buildbefore", but the anchor generated by vitepress is "build-before".
More Information
typedoc-plugin-markdown/packages/typedoc-vitepress-theme/src/index.ts
Lines 78 to 85 in 834b810
| function slugifyAnchor(anchor: string) { | |
| return anchor | |
| .toLowerCase() | |
| .trim() | |
| .replace(/[^\w\s-]/g, '') | |
| .replace(/[\s_-]+/g, '-') | |
| .replace(/^-+|-+$/g, ''); | |
| } |
I noticed that the above implementation is wrong. Line 82 eliminates all non-alphanumeric and "-" characters, which is inconsistent with the implementation of VitePress.
I found the anchor generation code used by vitepress, we can reuse it.
TypeDoc configuration
{
"$schema": "https://typedoc.org/schema.json",
"entryPointStrategy": "packages",
"entryPoints": ["../packages/wxt"],
"plugin": [
"typedoc-plugin-markdown",
"typedoc-vitepress-theme",
"typedoc-plugin-frontmatter"
],
"out": "./api/reference",
"githubPages": false,
"excludePrivate": true,
"excludeProtected": true,
"excludeInternal": true,
"readme": "none",
"frontmatterGlobals": {
"editLink": false
}
}
Expected behavior
typedoc generates "build-before" anchor.
Metadata
Metadata
Assignees
Labels
bugIssue raised as a bug.Issue raised as a bug.