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/text.rs | |
| parent | 2bf32c51bceb2f3a8b7ebea3d7c7d6d96757591b (diff) | |
Rework the core context
Diffstat (limited to 'src/library/text.rs')
| -rw-r--r-- | src/library/text.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/library/text.rs b/src/library/text.rs index ca903d1f..ba7f4c20 100644 --- a/src/library/text.rs +++ b/src/library/text.rs @@ -103,7 +103,7 @@ impl TextNode { #[skip] pub const LINK: Option<EcoString> = None; - fn construct(_: &mut Vm, args: &mut Args) -> TypResult<Template> { + fn construct(_: &mut Context, args: &mut Args) -> TypResult<Template> { // The text constructor is special: It doesn't create a text node. // Instead, it leaves the passed argument structurally unchanged, but // styles all text in it. @@ -117,15 +117,15 @@ pub struct StrongNode(pub Template); #[class] impl StrongNode { - fn construct(_: &mut Vm, args: &mut Args) -> TypResult<Template> { + fn construct(_: &mut Context, args: &mut Args) -> TypResult<Template> { Ok(Template::show(Self(args.expect("body")?))) } } impl Show for StrongNode { - fn show(&self, vm: &mut Vm, styles: StyleChain) -> TypResult<Template> { + fn show(&self, ctx: &mut Context, styles: StyleChain) -> TypResult<Template> { Ok(styles - .show(self, vm, [Value::Template(self.0.clone())])? + .show(self, ctx, [Value::Template(self.0.clone())])? .unwrap_or_else(|| self.0.clone().styled(TextNode::STRONG, true))) } } @@ -136,15 +136,15 @@ pub struct EmphNode(pub Template); #[class] impl EmphNode { - fn construct(_: &mut Vm, args: &mut Args) -> TypResult<Template> { + fn construct(_: &mut Context, args: &mut Args) -> TypResult<Template> { Ok(Template::show(Self(args.expect("body")?))) } } impl Show for EmphNode { - fn show(&self, vm: &mut Vm, styles: StyleChain) -> TypResult<Template> { + fn show(&self, ctx: &mut Context, styles: StyleChain) -> TypResult<Template> { Ok(styles - .show(self, vm, [Value::Template(self.0.clone())])? + .show(self, ctx, [Value::Template(self.0.clone())])? .unwrap_or_else(|| self.0.clone().styled(TextNode::EMPH, true))) } } |
