mirror of
https://github.com/typst/typst
synced 2025-05-13 20:46:23 +08:00
Hotfix for labels on symbols (#6015)
This commit is contained in:
parent
6271cdceae
commit
e1a9166e1d
@ -326,7 +326,10 @@ fn visit_math_rules<'a>(
|
||||
// Symbols in non-math content transparently convert to `TextElem` so we
|
||||
// don't have to handle them in non-math layout.
|
||||
if let Some(elem) = content.to_packed::<SymbolElem>() {
|
||||
let text = TextElem::packed(elem.text).spanned(elem.span());
|
||||
let mut text = TextElem::packed(elem.text).spanned(elem.span());
|
||||
if let Some(label) = elem.label() {
|
||||
text.set_label(label);
|
||||
}
|
||||
visit(s, s.store(text), styles)?;
|
||||
return Ok(true);
|
||||
}
|
||||
|
BIN
tests/ref/issue-5930-symbol-label.png
Normal file
BIN
tests/ref/issue-5930-symbol-label.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 243 B |
@ -151,3 +151,7 @@
|
||||
--- symbol-sect-deprecated ---
|
||||
// Warning: 5-9 `sect` is deprecated, use `inter` instead
|
||||
$ A sect B = A inter B $
|
||||
|
||||
--- issue-5930-symbol-label ---
|
||||
#emoji.face<lab>
|
||||
#context test(query(<lab>).first().text, "😀")
|
||||
|
Loading…
x
Reference in New Issue
Block a user