Fix spacing after raw blocks ⬇️

This commit is contained in:
Laurenz 2021-02-21 11:43:08 +01:00
parent 4ff59baf5e
commit 4d42c79b16
2 changed files with 9 additions and 4 deletions

View File

@ -103,14 +103,19 @@ impl Exec for NodeRaw {
let line_spacing = ctx.state.par.line_spacing.resolve(em); let line_spacing = ctx.state.par.line_spacing.resolve(em);
let mut children = vec![]; let mut children = vec![];
let mut newline = false;
for line in &self.lines { for line in &self.lines {
children.push(layout::Node::Text(ctx.make_text_node(line.clone()))); if newline {
children.push(layout::Node::Spacing(NodeSpacing { children.push(layout::Node::Spacing(NodeSpacing {
amount: line_spacing, amount: line_spacing,
softness: Softness::Hard, softness: Softness::Soft,
})); }));
} }
children.push(layout::Node::Text(ctx.make_text_node(line.clone())));
newline = true;
}
if self.block { if self.block {
ctx.apply_parbreak(); ctx.apply_parbreak();
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB