Skip to content

Commit

Permalink
Fix spacers in summary with folding.
Browse files Browse the repository at this point in the history
The spacer was incorrectly being included in the previous fold.
  • Loading branch information
expikr authored and ehuss committed May 13, 2024
1 parent a555c6b commit c2eb375
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/renderer/html_handlebars/helpers/toc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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\">")?;
Expand Down

0 comments on commit c2eb375

Please sign in to comment.