Skip to content

Commit

Permalink
Update toc.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
expikr committed Apr 16, 2024
1 parent c671c2e commit aa49649
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.get("spacer").is_some() {
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.get("spacer").is_some() {
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 aa49649

Please sign in to comment.