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("