Fix set document bug

This commit is contained in:
Laurenz 2023-02-12 13:23:48 +01:00
parent 8cbc2ac483
commit 2b26e08128
3 changed files with 5 additions and 4 deletions

View File

@ -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()
if styles.is_none()
&& (!self.flow.0.is_empty()
|| !self.par.0.is_empty()
|| !self.list.items.is_empty()
|| !self.list.items.is_empty())
{
bail!(span, "must appear before any content");
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 B

After

Width:  |  Height:  |  Size: 991 B

View File

@ -2,8 +2,8 @@
---
// This is okay.
// Ref: false
#set document(title: "Hello")
What's up?
---
Hello