summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-02-21 11:43:08 +0100
committerLaurenz <laurmaedje@gmail.com>2021-02-21 11:43:08 +0100
commit4d42c79b169063f6c8e7603db6777d0e60ff2e0b (patch)
treef432ddf579787778357f1c93a8c3aa501e924016
parent4ff59baf5e8268d607643aeec23d113cd40324c7 (diff)
Fix spacing after raw blocks ⬇️
-rw-r--r--src/exec/mod.rs13
-rw-r--r--tests/ref/markup/raw.pngbin8220 -> 8259 bytes
2 files changed, 9 insertions, 4 deletions
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 {
diff --git a/tests/ref/markup/raw.png b/tests/ref/markup/raw.png
index 6d90c960..198f9378 100644
--- a/tests/ref/markup/raw.png
+++ b/tests/ref/markup/raw.png
Binary files differ