Fix block spacing

This commit is contained in:
Laurenz 2023-04-02 19:45:53 +02:00
parent fa4878f7d0
commit b469f30c83
3 changed files with 15 additions and 2 deletions

View File

@ -466,8 +466,12 @@ impl<'a> FlowBuilder<'a> {
self.0.push(spacing.pack(), styles);
}
let above = BlockElem::above_in(styles);
let below = BlockElem::below_in(styles);
let (above, below) = if let Some(block) = content.to::<BlockElem>() {
(block.above(styles), block.below(styles))
} else {
(BlockElem::above_in(styles), BlockElem::below_in(styles))
};
self.0.push(above.pack(), styles);
self.0.push(content.clone(), styles);
self.0.push(below.pack(), styles);

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -0,0 +1,9 @@
// Test block spacing.
---
#set block(spacing: 10pt)
Hello
There
#block(spacing: 20pt)[Further down]