diff options
Diffstat (limited to 'src/library/math')
| -rw-r--r-- | src/library/math/mod.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/library/math/mod.rs b/src/library/math/mod.rs index c5b79117..b43db22e 100644 --- a/src/library/math/mod.rs +++ b/src/library/math/mod.rs @@ -13,8 +13,8 @@ pub struct MathNode { #[class] impl MathNode { - fn construct(_: &mut Context, args: &mut Args) -> TypResult<Template> { - Ok(Template::show(Self { + fn construct(_: &mut Context, args: &mut Args) -> TypResult<Content> { + Ok(Content::show(Self { formula: args.expect("formula")?, display: args.named("display")?.unwrap_or(false), })) @@ -22,18 +22,18 @@ impl MathNode { } impl Show for MathNode { - fn show(&self, ctx: &mut Context, styles: StyleChain) -> TypResult<Template> { + fn show(&self, ctx: &mut Context, styles: StyleChain) -> TypResult<Content> { Ok(styles .show(self, ctx, [ Value::Str(self.formula.clone()), Value::Bool(self.display), ])? .unwrap_or_else(|| { - let mut template = Template::Text(self.formula.trim().into()); + let mut content = Content::Text(self.formula.trim().into()); if self.display { - template = Template::Block(template.pack()); + content = Content::Block(content.pack()); } - template.monospaced() + content.monospaced() })) } } |
