Prevent block spacing with placed elements (#2244)

This commit is contained in:
Eric Biedert 2023-09-26 16:59:51 +02:00 committed by GitHub
parent 962071619d
commit 0d39fa021f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 0 deletions

View File

@ -547,6 +547,7 @@ impl<'a> FlowBuilder<'a> {
if content.is::<VElem>()
|| content.is::<ColbreakElem>()
|| content.is::<MetaElem>()
|| content.is::<PlaceElem>()
{
self.0.push(content.clone(), styles);
return true;

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

@ -0,0 +1,15 @@
// Test that placed elements don't add extra block spacing.
---
#show figure: set block(spacing: 4em)
Paragraph before float.
#figure(rect(), placement: bottom)
Paragraph after float.
---
#show place: set block(spacing: 4em)
Paragraph before place.
#place(rect())
Paragraph after place.