vuepress icon indicating copy to clipboard operation
vuepress copied to clipboard

Anchors starting with a number cause incompability with linting tools

Open RaimondB opened this issue 2 years ago • 0 comments

  • [X ] I confirm that this is an issue rather than a question.

Bug report

An earlier issue #121 that was fixed causes incompatibility with linting tools. Vuepress will prefix anchorlinks that start with a digit with an underscore. Widely used tools such as markdownlint and markdownlinkcheck don't do this an therefore break when headings are used that start with a digit and anchors or TOCs are created.

Steps to reproduce

  1. Create a vuepress site
  2. Add markdownlint or markdownlinkcheck in your CI/CD pipeline
  3. Create a heading that starts with a digit
  4. Create an internal link to the heading
  5. Run the CI/CD pipeline

What is expected?

When CI/CD passes, it should also work in VuePress

What is actually happening?

When CI/CD passes, the link will not work in vuepress. When changed to work in vuepress, the CI/CD will break.

Other relevant information

  • Output of npx vuepress info in my VuePress project:

RaimondB avatar Jan 20 '23 15:01 RaimondB