Merge pull request #2364 from expikr/patch-3

Fix dividers being folded by sections
This commit is contained in:
Eric Huss 2024-05-14 16:04:42 +00:00 committed by GitHub
commit cb0a992d8d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -74,12 +74,6 @@ impl HelperDef for RenderToc {
let mut is_first_chapter = ctx.data().get("is_index").is_some();
for item in chapters {
// Spacer
if item.contains_key("spacer") {
out.write("<li class=\"spacer\"></li>")?;
continue;
}
let (section, level) = if let Some(s) = item.get("section") {
(s.as_str(), s.matches('.').count())
} else {
@ -118,6 +112,12 @@ impl HelperDef for RenderToc {
}
}
// Spacer
if item.contains_key("spacer") {
out.write("<li class=\"spacer\"></li>")?;
continue;
}
// Part title
if let Some(title) = item.get("part") {
out.write("<li class=\"part-title\">")?;