mirror of
https://github.com/typst/typst
synced 2025-05-14 17:15:28 +08:00
Hotfix for labels on symbols (#6015)
This commit is contained in:
parent
e0074dfc01
commit
fe94b2b54f
@ -326,7 +326,10 @@ fn visit_math_rules<'a>(
|
|||||||
// Symbols in non-math content transparently convert to `TextElem` so we
|
// Symbols in non-math content transparently convert to `TextElem` so we
|
||||||
// don't have to handle them in non-math layout.
|
// don't have to handle them in non-math layout.
|
||||||
if let Some(elem) = content.to_packed::<SymbolElem>() {
|
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)?;
|
visit(s, s.store(text), styles)?;
|
||||||
return Ok(true);
|
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 ---
|
--- symbol-sect-deprecated ---
|
||||||
// Warning: 5-9 `sect` is deprecated, use `inter` instead
|
// Warning: 5-9 `sect` is deprecated, use `inter` instead
|
||||||
$ A sect B = A inter B $
|
$ 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