Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug report] Anchors for #### cannot be linked to #1

Open
KnorpelSenf opened this issue Sep 12, 2022 · 4 comments
Open

[Bug report] Anchors for #### cannot be linked to #1

KnorpelSenf opened this issue Sep 12, 2022 · 4 comments
Labels
documentation Improvements or additions to documentation

Comments

@KnorpelSenf
Copy link

Description

Headers with 4 indents (#### Name) cannot be linked to by clicking the header anchor. This will scroll to the right position on mobile, but the URL will be set to the parent anchor. Links to the sections work, but once they're opened, they will be rewritten to the parent anchor.

Reproduction

https://grammy.dev/plugins/keyboard.html#example-1

Used Package Manager

npm

System Info

# This command fails
$ npx vuepress info
⠋ Collecting Environment InfoTypeError: envinfo.run is not a function
    at info (file:///home/steffen/git/grammy-website/site/node_modules/@vuepress/cli/dist/index.js:525:32)
    at CAC.wrappedCommand (file:///home/steffen/git/grammy-website/site/node_modules/@vuepress/cli/dist/index.js:584:39)
    at CAC.runMatchedCommand (file:///home/steffen/git/grammy-website/site/node_modules/cac/dist/index.mjs:610:34)
    at CAC.parse (file:///home/steffen/git/grammy-website/site/node_modules/cac/dist/index.mjs:537:12)
    at cli (file:///home/steffen/git/grammy-website/site/node_modules/@vuepress/cli/dist/index.js:602:11)
    at file:///home/steffen/git/grammy-website/site/node_modules/vuepress-vite/bin/vuepress.js:8:1
    at ModuleJob.run (node:internal/modules/esm/module_job:195:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:337:24)
    at async loadESM (node:internal/process/esm_loader:88:5)

# so here are my deps
$ cat package.json | jq '.devDependencies'
{
  "@vuepress/plugin-docsearch": "^2.0.0-beta.51",
  "deno-bin": ">=1.25.2",
  "static-sitemap-cli": "^2.1.2",
  "vuepress-vite": "^2.0.0-beta.51"
}

# and here is my system info:
$ uname -smv && node -v && npm -v
Linux vuepress/vuepress-next#1 SMP Debian 5.10.136-1 (2022-08-13) x86_64
v17.3.0
8.12.1
@Mister-Hope
Copy link
Member

Mister-Hope commented Sep 12, 2022

I do think that's expected, because they are not in header list.

By default vuepress only extract level 2 and level 3 headers, but we give you ability to extract more level. If you extract level 4, then you will get the result which you are expecting.

@KnorpelSenf
Copy link
Author

Is there a configuration option about that which I'm not aware of?

@Mister-Hope
Copy link
Member

Yes
image

@Mister-Hope
Copy link
Member

Mister-Hope commented Sep 23, 2022

@meteorlxy cc, I do think that adding a note here is pretty bad, we'd better make some descriptions in markdown.headers and markdown.toc

@Mister-Hope Mister-Hope added the documentation Improvements or additions to documentation label Sep 23, 2022
@meteorlxy meteorlxy transferred this issue from vuepress/core Dec 3, 2023
@meteorlxy meteorlxy transferred this issue from vuepress/ecosystem Dec 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants