Fix text show-set regression (#3410)

This commit is contained in:
Laurenz 2024-02-14 09:45:25 +01:00 committed by GitHub
parent 1f68e15725
commit 8ed1eff7b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 46 additions and 1 deletions

View File

@ -129,7 +129,11 @@ fn verdict<'a>(
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
// it.
if !prepared {

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

View 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