Fix spacers in summary with folding.

The spacer was incorrectly being included in the previous fold.
This commit is contained in:
expikr 2024-04-16 08:45:43 -07:00 committed by Eric Huss
parent a555c6b6b2
commit c2eb375f69

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\">")?;