summaryrefslogtreecommitdiff
path: root/library
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-02-12 13:23:48 +0100
committerLaurenz <laurmaedje@gmail.com>2023-02-12 13:23:48 +0100
commit2b26e0812877b5a42b62c4bfc8b63a8e61283bff (patch)
tree4493c7b91562a13a5d8af0ee48d2cf1ac0e4b3a6 /library
parent8cbc2ac4832d659255e6f509ef6db66c69bda918 (diff)
Fix set document bug
Diffstat (limited to 'library')
-rw-r--r--library/src/layout/mod.rs7
1 files changed, 4 insertions, 3 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");
}