summaryrefslogtreecommitdiff
path: root/tests/typ/compiler/show-set-func.typ
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2024-02-01 14:30:17 +0100
committerGitHub <noreply@github.com>2024-02-01 13:30:17 +0000
commit7d33436e55f8b1aec06d136ebe095dd86bf23e57 (patch)
tree2c7b0673ef7a1992c03ef0b3aad4c25a29490400 /tests/typ/compiler/show-set-func.typ
parent426445edfc8d32d9ff8fcb79cda5b7765209f567 (diff)
Fix show-set semantics (#3311)
Diffstat (limited to 'tests/typ/compiler/show-set-func.typ')
-rw-r--r--tests/typ/compiler/show-set-func.typ16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/typ/compiler/show-set-func.typ b/tests/typ/compiler/show-set-func.typ
new file mode 100644
index 00000000..0447d946
--- /dev/null
+++ b/tests/typ/compiler/show-set-func.typ
@@ -0,0 +1,16 @@
+// Test set rules on an element in show rules for said element.
+
+---
+// These are both red because in the expanded form, `set text(red)` ends up
+// closer to the content than `set text(blue)`.
+#show strong: it => { set text(red); it }
+Hello *World*
+
+#show strong: it => { set text(blue); it }
+Hello *World*
+
+---
+// This doesn't have an effect. An element is materialized before any show
+// rules run.
+#show heading: it => { set heading(numbering: "(I)"); it }
+= Heading