diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-11-07 12:21:12 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-11-07 12:46:05 +0100 |
| commit | efd1853d069fbd1476e82d015da4d0d04cfaccc0 (patch) | |
| tree | 842b745c134306539d10c61be9485794fe8dc7dc /library/src/structure/reference.rs | |
| parent | eb951c008beea502042db4a3a0e8d1f8b51f6f52 (diff) | |
Show it!
- New show rule syntax
- Set if syntax
- Removed wrap syntax
Diffstat (limited to 'library/src/structure/reference.rs')
| -rw-r--r-- | library/src/structure/reference.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/library/src/structure/reference.rs b/library/src/structure/reference.rs index 56f8b8e3..18f4eecb 100644 --- a/library/src/structure/reference.rs +++ b/library/src/structure/reference.rs @@ -8,23 +8,23 @@ pub struct RefNode(pub EcoString); #[node(Show)] impl RefNode { fn construct(_: &mut Vm, args: &mut Args) -> SourceResult<Content> { - Ok(Self(args.expect("label")?).pack()) - } -} - -impl Show for RefNode { - fn unguard_parts(&self, _: Selector) -> Content { - Self(self.0.clone()).pack() + Ok(Self(args.expect("target")?).pack()) } fn field(&self, name: &str) -> Option<Value> { match name { - "label" => Some(Value::Str(self.0.clone().into())), + "target" => Some(Value::Str(self.0.clone().into())), _ => None, } } +} + +impl Show for RefNode { + fn unguard_parts(&self, _: Selector) -> Content { + Self(self.0.clone()).pack() + } - fn realize(&self, _: Tracked<dyn World>, _: StyleChain) -> SourceResult<Content> { - Ok(TextNode(format_eco!("@{}", self.0)).pack()) + fn show(&self, _: Tracked<dyn World>, _: StyleChain) -> SourceResult<Content> { + Ok(TextNode::packed(format_eco!("@{}", self.0))) } } |
