diff options
| -rw-r--r-- | library/src/layout/mod.rs | 7 | ||||
| -rw-r--r-- | tests/ref/meta/document.png | bin | 68 -> 991 bytes | |||
| -rw-r--r-- | tests/typ/meta/document.typ | 2 |
3 files changed, 5 insertions, 4 deletions
diff --git a/library/src/layout/mod.rs b/library/src/layout/mod.rs index 7f395545..6c01759c 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 Binary files differindex bc0a95bf..aa3da163 100644 --- a/tests/ref/meta/document.png +++ b/tests/ref/meta/document.png diff --git a/tests/typ/meta/document.typ b/tests/typ/meta/document.typ index bbe8dafa..e8d53650 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 |
