diff options
Diffstat (limited to 'src/eval')
| -rw-r--r-- | src/eval/template.rs | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/eval/template.rs b/src/eval/template.rs index e9cbbfcf..d447161a 100644 --- a/src/eval/template.rs +++ b/src/eval/template.rs @@ -337,13 +337,24 @@ impl Builder { /// Push a block node into the active flow, finishing the active paragraph. fn block(&mut self, node: PackedNode) { + let mut is_placed = false; + if let Some(placed) = node.downcast::<PlacedNode>() { + is_placed = true; + + // This prevents paragraph spacing after the placed node if it + // is completely out-of-flow. + if placed.out_of_flow() { + self.flow.last = Last::None; + } + } + self.parbreak(); - let in_flow = node.downcast::<PlacedNode>().is_none(); self.flow.push(FlowChild::Node(node)); - if in_flow { - self.parbreak(); - } else { - // This prevents duplicate paragraph spacing around placed nodes. + self.parbreak(); + + // This prevents paragraph spacing between the placed node and + // the paragraph below it. + if is_placed { self.flow.last = Last::None; } } |
