diff options
Diffstat (limited to 'library/src/structure/heading.rs')
| -rw-r--r-- | library/src/structure/heading.rs | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/library/src/structure/heading.rs b/library/src/structure/heading.rs index 62a67000..46e98c18 100644 --- a/library/src/structure/heading.rs +++ b/library/src/structure/heading.rs @@ -12,7 +12,7 @@ pub struct HeadingNode { pub body: Content, } -#[node(Show)] +#[node(Show, Finalize)] impl HeadingNode { /// The heading's font family. Just the normal text family if `auto`. #[property(referenced)] @@ -67,12 +67,6 @@ impl HeadingNode { } .pack()) } -} - -impl Show for HeadingNode { - fn unguard_parts(&self, sel: Selector) -> Content { - Self { body: self.body.unguard(sel), ..*self }.pack() - } fn field(&self, name: &str) -> Option<Value> { match name { @@ -81,11 +75,19 @@ impl Show for HeadingNode { _ => None, } } +} - fn realize(&self, _: Tracked<dyn World>, _: StyleChain) -> SourceResult<Content> { +impl Show for HeadingNode { + fn unguard_parts(&self, sel: Selector) -> Content { + Self { body: self.body.unguard(sel), ..*self }.pack() + } + + fn show(&self, _: Tracked<dyn World>, _: StyleChain) -> SourceResult<Content> { Ok(BlockNode(self.body.clone()).pack()) } +} +impl Finalize for HeadingNode { fn finalize( &self, world: Tracked<dyn World>, |
