From c0f6d2004afebfa9412ba0c2d598ef8287197c42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20d=27Herbais=20de=20Thun?= Date: Mon, 6 Nov 2023 21:37:50 +0100 Subject: Content rework 2 - Electric Boogaloo (#2504) --- crates/typst-library/src/text/shift.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/typst-library/src/text/shift.rs') diff --git a/crates/typst-library/src/text/shift.rs b/crates/typst-library/src/text/shift.rs index 6cb4d895..903982ef 100644 --- a/crates/typst-library/src/text/shift.rs +++ b/crates/typst-library/src/text/shift.rs @@ -44,7 +44,7 @@ pub struct SubElem { impl Show for SubElem { #[tracing::instrument(name = "SubElem::show", skip_all)] fn show(&self, vt: &mut Vt, styles: StyleChain) -> SourceResult { - let body = self.body(); + let body = self.body().clone(); let mut transformed = None; if self.typographic(styles) { if let Some(text) = search_text(&body, true) { @@ -104,7 +104,7 @@ pub struct SuperElem { impl Show for SuperElem { #[tracing::instrument(name = "SuperElem::show", skip_all)] fn show(&self, vt: &mut Vt, styles: StyleChain) -> SourceResult { - let body = self.body(); + let body = self.body().clone(); let mut transformed = None; if self.typographic(styles) { if let Some(text) = search_text(&body, false) { @@ -127,7 +127,7 @@ fn search_text(content: &Content, sub: bool) -> Option { if content.is::() { Some(' '.into()) } else if let Some(elem) = content.to::() { - convert_script(&elem.text(), sub) + convert_script(elem.text(), sub) } else if let Some(children) = content.to_sequence() { let mut full = EcoString::new(); for item in children { -- cgit v1.2.3