-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Cannot access page headers that are not h2 or h3 #1903
Cannot access page headers that are not h2 or h3 #1903
Comments
Hi @lesliecdubs, Thanks for the report. If I correctly understand, the only thing you need is including
Would that solve your problem? |
Jumping in here, since @lesliecdubs and I worked on this, yeah, that would solve the problem! The other option would be pulling in the desired headers from the vuepress config. |
See #1945 |
Bug report
Currently, header levels are hard-coded in VuePress core.
This limits our ability to access header levels beyond
h3
.Our use case for this is a custom table of contents component that we are displaying on every page of our site. Our content uses
h4
s.We don't want header levels below
h3
to show up in our table of contents; however, we'd like for the precedingh3
to maintain the active indicator once a user has scrolled past anh4
.What is expected?
There should be some way to customize the header levels that are stored in
this.$page.headers
.What is actually happening?
Header levels stored in
this.$page.headers
are hard-coded to only includeh2
andh3
.cc @shortdiv
The text was updated successfully, but these errors were encountered: