diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-11-21 16:12:24 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-11-21 16:12:24 +0100 |
| commit | 1d7e082d1d83d4c7e454a2d08258794d716aea1a (patch) | |
| tree | 73ee43a9d039edbe34c81a4ea6f4ec4f7f9e11cf /tests | |
| parent | fd7b9d9e1eb8eef60c20e65dfc946c4424f02c8f (diff) | |
Labels
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ref/style/label.png | bin | 0 -> 18402 bytes | |||
| -rw-r--r-- | tests/typ/style/label.typ | 54 |
2 files changed, 54 insertions, 0 deletions
diff --git a/tests/ref/style/label.png b/tests/ref/style/label.png Binary files differnew file mode 100644 index 00000000..836899e1 --- /dev/null +++ b/tests/ref/style/label.png diff --git a/tests/typ/style/label.typ b/tests/typ/style/label.typ new file mode 100644 index 00000000..0b667783 --- /dev/null +++ b/tests/typ/style/label.typ @@ -0,0 +1,54 @@ +// Test labels. + +--- +// Test labelled headings. +#show heading: text.with(10pt) +#show heading.where(label: "intro"): underline + += Introduction <intro> +The beginning. + += Conclusion +The end. + +--- +// Test label after expression. +#show strong.where(label: "v"): text.with(red) + +#let a = [*A*] +#let b = [*B*] +#a <v> #b + +--- +// Test labelled text. +#show "t": it => { + 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"): text.with(red) +#show strong.where(label: "blue"): text.with(blue) + +*A* *B* <red> *C* <blue> *D* + +--- +// Test that label ignores parbreak. +#show emph.where(label: "hide"): none + +_Hidden_ +<hide> + +_Hidden_ + +<hide> +_Visible_ + +--- +// Test that label only works within one content block. +#show strong.where(label: "strike"): strike +*This is* [<strike>] *protected.* +*This is not.* <strike> |
