From c2eb375f699bd30cb04037323b1343c4356a395a Mon Sep 17 00:00:00 2001 From: expikr <77922942+expikr@users.noreply.github.com> Date: Tue, 16 Apr 2024 08:45:43 -0700 Subject: [PATCH] Fix spacers in summary with folding. The spacer was incorrectly being included in the previous fold. --- src/renderer/html_handlebars/helpers/toc.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/renderer/html_handlebars/helpers/toc.rs b/src/renderer/html_handlebars/helpers/toc.rs index 81da5ef542..aabea028c0 100644 --- a/src/renderer/html_handlebars/helpers/toc.rs +++ b/src/renderer/html_handlebars/helpers/toc.rs @@ -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("
  • ")?; - 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("
  • ")?; + continue; + } + // Part title if let Some(title) = item.get("part") { out.write("
  • ")?;