From 6a0c1ca3f8c8602970bbd5d2ea41165e92649f92 Mon Sep 17 00:00:00 2001 From: Noah Hellman Date: Fri, 2 Dec 2022 20:07:37 +0100 Subject: [PATCH] fixup! 21784e2a57450d4ca120f62c317331c6feb1cbbd --- src/block.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/block.rs b/src/block.rs index 3f9f87a..cefe482 100644 --- a/src/block.rs +++ b/src/block.rs @@ -98,16 +98,16 @@ impl<'s> Parser<'s> { first.end() - first.of(self.src).trim_start().len(), first.end(), ); - let len = match l { - CodeBlock { .. } => line_count - 2, + let line_count = match l { + CodeBlock { .. } => line_count - 1, _ => line_count, }; if !matches!(l, Leaf::CodeBlock { .. }) { // trim ending whitespace of block - let last = &mut lines[len - 1]; + let last = &mut lines[line_count - 1]; *last = last.with_len(last.of(self.src).trim_end().len()); } - for line in &lines[0..len] { + for line in &lines[0..line_count] { self.tree.elem(Atom::Inline, *line); } }