Auto scroll doesn't work for h6 headings.
Description
I discovered this because some of the links that show up in the search plugin do not auto scroll to the correct location.
It seems that for quite some time, the onNavigate query selector only goes down to h5.
Surely this line should be :where(h1, h2, h3, h4, h5, h6) no?
Expected behavior
When clicking on a link that includes an anchor that is an h6 header ###### Header, the page should navigate to the correct page and then auto scroll to the correct header.
Actual behavior
The page navigates to the correct page but it does not scroll at all. It doesn't scroll to the anchor or to the top of the page like it should. It ends up in a location based on the scrollTop position of the page navigated way from, which can be quite disorienting.
Steps to reproduce
- Create a document
test.mdwith a large amount of content to make sure that there is enough to create scrolling - At the bottom of the document add
###### Test - In
_sidebar.mdadd- [Test](test.md#test) - Load the page and click the
Testin the sidebar - Observe that
test.mdis loaded but does not auto scroll to theTestsection.
Environment
- Docsify Version: 5.0.0-rc
- Browser Version: all
Additional Information
- [x] Bug still occurs when all/other plugins are disabled?
I'm not sure why I omitted the h6 tag earlier, but I think adding it should be fine.
@sy-records thanks for taking the time to respond.
Yea I figured it was probably just an honest mistake but I questioned why no one else had hit this issue in all this time. So I thought maybe I was doing something wrong.
I suspect not many people link directly to an h6. As mentioned, I discovered it only because the search results were not behaving correctly. I have a bunch of documents that are generated from the typedoc markdown plugin and sometimes it will include an h6.
It's a simple enough PR to make but I couldn't find any tests related to the auto scroll. If you could point me to them (presuming there are any) I can submit a PR.
Hey i want to contribute to fix this issue
Welcome to submit PR