mirror of
https://github.com/typst/typst
synced 2025-05-14 04:56:26 +08:00
Fix text show-set regression (#3410)
This commit is contained in:
parent
1f68e15725
commit
8ed1eff7b5
@ -129,7 +129,11 @@ fn verdict<'a>(
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Transformation::Style(transform) = &recipe.transform {
|
// Special handling for show-set rules. Exception: Regex show rules,
|
||||||
|
// those need to be handled like normal transformations.
|
||||||
|
if let (Transformation::Style(transform), false) =
|
||||||
|
(&recipe.transform, matches!(&recipe.selector, Some(Selector::Regex(_))))
|
||||||
|
{
|
||||||
// If this is a show-set for an unprepared element, we need to apply
|
// If this is a show-set for an unprepared element, we need to apply
|
||||||
// it.
|
// it.
|
||||||
if !prepared {
|
if !prepared {
|
||||||
|
BIN
tests/ref/compiler/show-set-text.png
Normal file
BIN
tests/ref/compiler/show-set-text.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.5 KiB |
41
tests/typ/compiler/show-set-text.typ
Normal file
41
tests/typ/compiler/show-set-text.typ
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
// Text show-set rules are weird.
|
||||||
|
|
||||||
|
---
|
||||||
|
#show "He": set text(red)
|
||||||
|
#show "ya": set text(blue)
|
||||||
|
Heya
|
||||||
|
|
||||||
|
---
|
||||||
|
#show "Heya": set text(red)
|
||||||
|
#show "ya": set text(blue)
|
||||||
|
Heya
|
||||||
|
|
||||||
|
---
|
||||||
|
#show "He": set text(red)
|
||||||
|
#show "Heya": set text(blue)
|
||||||
|
Heya
|
||||||
|
|
||||||
|
---
|
||||||
|
#show "Heya": set text(red)
|
||||||
|
#show "yaho": set text(blue)
|
||||||
|
Heyaho
|
||||||
|
|
||||||
|
---
|
||||||
|
#show "He": set text(red)
|
||||||
|
#show "ya": set text(weight: "bold")
|
||||||
|
Heya
|
||||||
|
|
||||||
|
---
|
||||||
|
#show "Heya": set text(red)
|
||||||
|
#show "ya": set text(weight: "bold")
|
||||||
|
Heya
|
||||||
|
|
||||||
|
---
|
||||||
|
#show "He": set text(red)
|
||||||
|
#show "Heya": set text(weight: "bold")
|
||||||
|
Heya
|
||||||
|
|
||||||
|
---
|
||||||
|
#show "Heya": set text(red)
|
||||||
|
#show "yaho": set text(weight: "bold")
|
||||||
|
Heyaho
|
Loading…
x
Reference in New Issue
Block a user