This website requires JavaScript.
Explore
Help
Sign in
jesus
/
mdbook
Watch
1
Star
0
Fork
You've already forked mdbook
0
Code
Issues
Pull requests
Projects
Releases
Packages
Wiki
Activity
Actions
8ba833feb2
mdbook
/
tests
/
gui
/
books
/
heading-nav-folded
/
src
/
next-main.md
2 lines
20 B
Markdown
Raw
Normal View
History
Unescape
Escape
Fix heading nav with folded chapters This fixes an issue when folding is enabled. The folding was not properly hiding the sub-chapters because it was assuming it could hide the next list element. However, the heading nav was the next list element, so the remaining chapters remained visible. The solution required some deeper changes to how the chapters were organized in the sidebar. Instead of nested chapters being a list element *sibling*, the nested chapter's `ol` is now a *child* of its parent chapter. This makes it much easier to just hide everything without regard of the exact sibling order. This required wrapping the chapter title and the toggle chevron inside a span so that the flex layout could be localized to just those elements, and allow the following `ol` elements to lay out regularly. Closes https://github.com/rust-lang/mdBook/issues/2880
2025-10-20 17:29:31 -07:00
# Next main chapter
Reference in a new issue
Copy permalink