diff --git a/library/src/layout/mod.rs b/library/src/layout/mod.rs index 7f395545b..6c01759cb 100644 --- a/library/src/layout/mod.rs +++ b/library/src/layout/mod.rs @@ -433,9 +433,10 @@ impl<'a, 'v, 't> Builder<'a, 'v, 't> { if self.doc.is_none() { bail!(span, "not allowed here"); } - if !self.flow.0.is_empty() - || !self.par.0.is_empty() - || !self.list.items.is_empty() + if styles.is_none() + && (!self.flow.0.is_empty() + || !self.par.0.is_empty() + || !self.list.items.is_empty()) { bail!(span, "must appear before any content"); } diff --git a/tests/ref/meta/document.png b/tests/ref/meta/document.png index bc0a95bfa..aa3da1637 100644 Binary files a/tests/ref/meta/document.png and b/tests/ref/meta/document.png differ diff --git a/tests/typ/meta/document.typ b/tests/typ/meta/document.typ index bbe8dafa7..e8d536505 100644 --- a/tests/typ/meta/document.typ +++ b/tests/typ/meta/document.typ @@ -2,8 +2,8 @@ --- // This is okay. -// Ref: false #set document(title: "Hello") +What's up? --- Hello