diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-11-26 13:39:18 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-11-26 13:41:27 +0100 |
| commit | 7af46fc025ee08eb78ae7f6898300083c886bf6f (patch) | |
| tree | 5837d972961844650bc9668d8516d7b5239a8d18 /tests | |
| parent | 3cdd8bfa40fe5fdf0c676af905c3c2c1f614ef24 (diff) | |
Dynamic labels
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ref/style/label.png | bin | 18402 -> 20873 bytes | |||
| -rw-r--r-- | tests/typ/style/label.typ | 22 |
2 files changed, 13 insertions, 9 deletions
diff --git a/tests/ref/style/label.png b/tests/ref/style/label.png Binary files differindex 836899e1..ffad978c 100644 --- a/tests/ref/style/label.png +++ b/tests/ref/style/label.png diff --git a/tests/typ/style/label.typ b/tests/typ/style/label.typ index 3ce0c02c..795c0435 100644 --- a/tests/typ/style/label.typ +++ b/tests/typ/style/label.typ @@ -3,7 +3,7 @@ --- // Test labelled headings. #show heading: set text(10pt) -#show heading.where(label: "intro"): underline +#show heading.where(label: <intro>): underline = Introduction <intro> The beginning. @@ -13,7 +13,7 @@ The end. --- // Test label after expression. -#show strong.where(label: "v"): set text(red) +#show strong.where(label: <v>): set text(red) #let a = [*A*] #let b = [*B*] @@ -22,22 +22,22 @@ The end. --- // Test labelled text. #show "t": it => { - set text(blue) if it.label == "last" + set text(blue) if it.label == <last> it } This is a thing [that <last>] happened. --- -// Test abusing labels for styling. -#show strong.where(label: "red"): set text(red) -#show strong.where(label: "blue"): set text(blue) +// Test abusing dynamic labels for styling. +#show <red>: set text(red) +#show <blue>: set text(blue) -*A* *B* <red> *C* <blue> *D* +*A* *B* <red> *C* #label("bl" + "ue") *D* --- // Test that label ignores parbreak. -#show emph.where(label: "hide"): none +#show <hide>: none _Hidden_ <hide> @@ -49,6 +49,10 @@ _Visible_ --- // Test that label only works within one content block. -#show strong.where(label: "strike"): strike +#show <strike>: strike *This is* [<strike>] *protected.* *This is not.* <strike> + +--- +// Test that incomplete label is text. +1 < 2 is #if 1 < 2 [not] a label. |
