mirror of https://github.com/stelzo/typst.git
Fix block spacing
This commit is contained in:
parent
fa4878f7d0
commit
b469f30c83
|
|
@ -466,8 +466,12 @@ impl<'a> FlowBuilder<'a> {
|
||||||
self.0.push(spacing.pack(), styles);
|
self.0.push(spacing.pack(), styles);
|
||||||
}
|
}
|
||||||
|
|
||||||
let above = BlockElem::above_in(styles);
|
let (above, below) = if let Some(block) = content.to::<BlockElem>() {
|
||||||
let below = BlockElem::below_in(styles);
|
(block.above(styles), block.below(styles))
|
||||||
|
} else {
|
||||||
|
(BlockElem::above_in(styles), BlockElem::below_in(styles))
|
||||||
|
};
|
||||||
|
|
||||||
self.0.push(above.pack(), styles);
|
self.0.push(above.pack(), styles);
|
||||||
self.0.push(content.clone(), styles);
|
self.0.push(content.clone(), styles);
|
||||||
self.0.push(below.pack(), styles);
|
self.0.push(below.pack(), styles);
|
||||||
|
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
|
|
@ -0,0 +1,9 @@
|
||||||
|
// Test block spacing.
|
||||||
|
|
||||||
|
---
|
||||||
|
#set block(spacing: 10pt)
|
||||||
|
Hello
|
||||||
|
|
||||||
|
There
|
||||||
|
|
||||||
|
#block(spacing: 20pt)[Further down]
|
||||||
Loading…
Reference in New Issue