mdBook icon indicating copy to clipboard operation
mdBook copied to clipboard

Spacers in sidebar don't appear at correct level

Open mattico opened this issue 6 years ago • 3 comments

For example, the spacer in SUMMARY.md is placed inside the subsection list, when it should be top-level:

image

mattico avatar Jul 24 '18 17:07 mattico

Just noticed this. Still happening.

mickvangelderen avatar May 31 '22 20:05 mickvangelderen

Copying my comment from #1730:

I suspect it would be around here, where it uses an <li> for the spacer. Perhaps it could use a different tag, like <hr>? However, this would need careful consideration of how it will change existing users, and whether or not it will affect their expected rendering.

ehuss avatar Jun 01 '22 03:06 ehuss

It seems like the <li> spacer is rendered as a child of the previous section (which also causes it to disappear when folding is enabled), so I think <hr> would be bound by the .section's padding-left either way.

Maybe, a workaround could be to delay this call (and remove the continue, since it seems to also break the next sections) to when current_level is back to 1 (possibly here, but it might bug when this runs).

This would force it to render inside .chapter and not inside li > .section, which would also fix its indentation.

alek3y avatar Feb 20 '23 11:02 alek3y

Fixed by #2364

expikr avatar May 17 '24 04:05 expikr

Thanks! I'm not sure why it didn't auto-close.

ehuss avatar May 17 '24 13:05 ehuss