summaryrefslogtreecommitdiff
path: root/crates/typst-realize
diff options
context:
space:
mode:
Diffstat (limited to 'crates/typst-realize')
-rw-r--r--crates/typst-realize/src/lib.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/crates/typst-realize/src/lib.rs b/crates/typst-realize/src/lib.rs
index 6ab6d81c..99db2ef1 100644
--- a/crates/typst-realize/src/lib.rs
+++ b/crates/typst-realize/src/lib.rs
@@ -16,7 +16,7 @@ use typst_library::engine::Engine;
use typst_library::foundations::{
Content, Context, ContextElem, Element, NativeElement, Recipe, RecipeIndex, Selector,
SequenceElem, Show, ShowSet, Style, StyleChain, StyleVec, StyledElem, Styles,
- Synthesize, Transformation,
+ SymbolElem, Synthesize, Transformation,
};
use typst_library::html::{tag, HtmlElem};
use typst_library::introspection::{Locatable, SplitLocator, Tag, TagElem};
@@ -221,7 +221,7 @@ impl<'a, 'x, 'y, 'z, 's> Grouped<'a, 'x, 'y, 'z, 's> {
/// Handles an arbitrary piece of content during realization.
fn visit<'a>(
s: &mut State<'a, '_, '_, '_>,
- content: &'a Content,
+ mut content: &'a Content,
styles: StyleChain<'a>,
) -> SourceResult<()> {
// Tags can always simply be pushed.
@@ -230,6 +230,12 @@ fn visit<'a>(
return Ok(());
}
+ if let Some(elem) = content.to_packed::<SymbolElem>() {
+ // This is a hack to avoid affecting layout that will be replaced in a
+ // later commit.
+ content = Box::leak(Box::new(TextElem::packed(elem.text.to_string())));
+ }
+
// Transformations for math content based on the realization kind. Needs
// to happen before show rules.
if visit_math_rules(s, content, styles)? {