diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-02-22 14:31:09 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-02-23 14:53:55 +0100 |
| commit | e1f29d6cb9437a4afb2e4fc4ee10a5b8717ab9fa (patch) | |
| tree | 1ce5f2bd858f6665d3867a2939d4b474c1b70377 /src/library/link.rs | |
| parent | 2bf32c51bceb2f3a8b7ebea3d7c7d6d96757591b (diff) | |
Rework the core context
Diffstat (limited to 'src/library/link.rs')
| -rw-r--r-- | src/library/link.rs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/library/link.rs b/src/library/link.rs index 41209549..4a153d46 100644 --- a/src/library/link.rs +++ b/src/library/link.rs @@ -21,7 +21,7 @@ impl LinkNode { /// Whether to underline link. pub const UNDERLINE: bool = true; - fn construct(_: &mut Vm, args: &mut Args) -> TypResult<Template> { + fn construct(_: &mut Context, args: &mut Args) -> TypResult<Template> { Ok(Template::show(Self { url: args.expect::<EcoString>("url")?, body: args.find()?, @@ -30,12 +30,15 @@ impl LinkNode { } impl Show for LinkNode { - fn show(&self, vm: &mut Vm, styles: StyleChain) -> TypResult<Template> { + fn show(&self, ctx: &mut Context, styles: StyleChain) -> TypResult<Template> { let mut body = styles - .show(self, vm, [Value::Str(self.url.clone()), match &self.body { - Some(body) => Value::Template(body.clone()), - None => Value::None, - }])? + .show(self, ctx, [ + Value::Str(self.url.clone()), + match &self.body { + Some(body) => Value::Template(body.clone()), + None => Value::None, + }, + ])? .or_else(|| self.body.clone()) .unwrap_or_else(|| { let url = &self.url; |
