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,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 {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB