From b0c55246570b9c04e732eee43e6c02d6f3a043a4 Mon Sep 17 00:00:00 2001 From: Konsta Hölttä Date: Sun, 25 Oct 2020 17:35:52 +0200 Subject: Decrement renderer level after section recursion (#16) The html renderer section level used for title numbering is incremented when entering a new section so that subsections get correct heading elements. Match the increment with a decrement after having rendered the section contents, so that multiple consecutive sections would stay consistent. Add a test to verify this behaviour.--- renderer/src/html.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'renderer/src/html.rs') diff --git a/renderer/src/html.rs b/renderer/src/html.rs index 0092315..bb7c42e 100644 --- a/renderer/src/html.rs +++ b/renderer/src/html.rs @@ -152,6 +152,7 @@ impl HTMLRender for e::Section { writeln!(renderer.stream)?; } write!(renderer.stream, "")?; + renderer.level -= 1; Ok(()) } } -- cgit v1.2.3