From 4d42c79b169063f6c8e7603db6777d0e60ff2e0b Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sun, 21 Feb 2021 11:43:08 +0100 Subject: =?UTF-8?q?Fix=20spacing=20after=20raw=20blocks=20=E2=AC=87?= =?UTF-8?q?=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/exec/mod.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/exec') diff --git a/src/exec/mod.rs b/src/exec/mod.rs index 3dbe8270..37c03cda 100644 --- a/src/exec/mod.rs +++ b/src/exec/mod.rs @@ -103,12 +103,17 @@ impl Exec for NodeRaw { let line_spacing = ctx.state.par.line_spacing.resolve(em); let mut children = vec![]; + let mut newline = false; for line in &self.lines { + if newline { + children.push(layout::Node::Spacing(NodeSpacing { + amount: line_spacing, + softness: Softness::Soft, + })); + } + children.push(layout::Node::Text(ctx.make_text_node(line.clone()))); - children.push(layout::Node::Spacing(NodeSpacing { - amount: line_spacing, - softness: Softness::Hard, - })); + newline = true; } if self.block { -- cgit v1.2.3