diff --git a/crates/typst-library/src/layout/mod.rs b/crates/typst-library/src/layout/mod.rs index 018cf1a69..4ff0bc92f 100644 --- a/crates/typst-library/src/layout/mod.rs +++ b/crates/typst-library/src/layout/mod.rs @@ -547,6 +547,7 @@ impl<'a> FlowBuilder<'a> { if content.is::() || content.is::() || content.is::() + || content.is::() { self.0.push(content.clone(), styles); return true; diff --git a/tests/ref/bugs/place-spacing.png b/tests/ref/bugs/place-spacing.png new file mode 100644 index 000000000..d14ce6ec1 Binary files /dev/null and b/tests/ref/bugs/place-spacing.png differ diff --git a/tests/typ/bugs/place-spacing.typ b/tests/typ/bugs/place-spacing.typ new file mode 100644 index 000000000..4d7b5fe38 --- /dev/null +++ b/tests/typ/bugs/place-spacing.typ @@ -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.