Skip to content
Discussion options

You must be logged in to vote

The key is plugin order. VitePress installs its own markdown-it-anchor before markdown.config runs, so adding your fork in config is too late: the built-in core rule throws first.

For this particular change, the least invasive solution is to run your fork in preConfig:

import { defineConfig } from 'vitepress'
import anchorPlugin from 'your-fork-of-markdown-it-anchor'

export default defineConfig({
  markdown: {
    preConfig(md) {
      // If another plugin creates heading ids, install it before this line.
      md.use(anchorPlugin, {
        permalink: false
      })
    }
  }
})

Your fork's core rule then runs first and changes the second explicit title-1 to title-1-1. VitePress's own a…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by otomad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants