From b0e5f375ba152f2399dde9bdf7abb6c43dbad075 Mon Sep 17 00:00:00 2001 From: Ian Thompson Date: Sat, 16 Jul 2016 10:23:22 -0400 Subject: [PATCH] Make sure are balanced --- src/renderer/html_handlebars/helpers/toc.rs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/renderer/html_handlebars/helpers/toc.rs b/src/renderer/html_handlebars/helpers/toc.rs index 7ecb4da6b7..7164a2228a 100644 --- a/src/renderer/html_handlebars/helpers/toc.rs +++ b/src/renderer/html_handlebars/helpers/toc.rs @@ -39,14 +39,17 @@ impl HelperDef for RenderToc { }; if level > current_level { - try!(rc.writer.write("
  • ".as_bytes())); - try!(rc.writer.write("".as_bytes())); + try!(rc.writer.write("
  • ".as_bytes())); + current_level -= 1; } try!(rc.writer.write("".as_bytes()));