summaryrefslogtreecommitdiff
path: root/tests/typ
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2024-02-15 11:07:07 +0100
committerGitHub <noreply@github.com>2024-02-15 10:07:07 +0000
commit1d78c3ed436d70ef4fe05930903bc4b0402161b6 (patch)
tree3736973c66c4f54b0264584367479ccc73352d65 /tests/typ
parentaabb4b5ecf67a5b51b0e550f0b06087465f4ba75 (diff)
Fix `h` and `v` in stack (#3423)
Diffstat (limited to 'tests/typ')
-rw-r--r--tests/typ/bugs/1240-stack-fr.typ18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/typ/bugs/1240-stack-fr.typ b/tests/typ/bugs/1240-stack-fr.typ
new file mode 100644
index 00000000..fa49dce7
--- /dev/null
+++ b/tests/typ/bugs/1240-stack-fr.typ
@@ -0,0 +1,18 @@
+// This issue is sort of horrible: When you write `h(1fr)` in a `stack` instead
+// of directly `1fr`, things go awry. To fix this, we now transparently detect
+// h/v children.
+//
+// https://github.com/typst/typst/issues/1240
+
+---
+#stack(dir: ltr, [a], 1fr, [b], 1fr, [c])
+#stack(dir: ltr, [a], h(1fr), [b], h(1fr), [c])
+
+---
+#set page(height: 60pt)
+#stack(
+ dir: ltr,
+ spacing: 1fr,
+ stack([a], 1fr, [b]),
+ stack([a], v(1fr), [b]),
+)