-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Discrepency between TOC component and auto sidebar #1399
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
Comments
So you actually want a sidebar similar to table of contents? It makes sense, but I really want to know what sidebar do you want the following title to generate?
|
hmmm, here's a test with the existing The goal of the sidebar is probably not to emulate the |
Thanks for your issue. I understand your question. The truth is, at present, when using some kinds of "abnormal" heading, neither the TOC nor the sidebar behave satisfactorily. We may provide a unified and comprehensive solution in a future release. |
Thanks for the followup - might be a good place for a PR if I have time to dig in |
@shigma one last question while I have you - are these the two different implementations?:
|
If you want to optimize TOC grouping behavior, you can modify this method: vuepress/packages/@vuepress/core/lib/client/components/TOC.vue Lines 32 to 54 in ff8df66
And contribution welcome! |
Uh oh!
There was an error while loading. Please reload this page.
Bug report
Version
0.14.10
Steps to reproduce
[[toc]]
component to the pageThis works:

With expected output:

This doesn't (notice

###
preceding 'Underlying' vs##
)With this output highlighting difference between sidebar and TOC

What is expected?
Auto sidebar would index all headers on page (same as TOC)
What is actually happening?
Auto sidebar skips indexing headers if there's a gap in header hierarchy. It will render an h3 contained in an h2, contained in an h1, but will not render an h3 contained in an h1. the
[[toc]]
build-in does not have this problem.Other relevant information
The text was updated successfully, but these errors were encountered: