From aeb036f4dc2ede271d6c0710e91fae605ecdac84 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sat, 29 Jan 2022 22:32:30 +0100 Subject: Fix that templates don't create a scope --- tests/ref/style/wrap.png | Bin 10612 -> 24733 bytes tests/typ/code/block.typ | 7 +++++++ tests/typ/style/wrap.typ | 6 ++++++ 3 files changed, 13 insertions(+) (limited to 'tests') diff --git a/tests/ref/style/wrap.png b/tests/ref/style/wrap.png index 346da53f..82d1c34d 100644 Binary files a/tests/ref/style/wrap.png and b/tests/ref/style/wrap.png differ diff --git a/tests/typ/code/block.typ b/tests/typ/code/block.typ index 5939ba9c..9122ea48 100644 --- a/tests/typ/code/block.typ +++ b/tests/typ/code/block.typ @@ -102,6 +102,13 @@ test(a, "a1") } +--- +// Template also creates a scope. +[#let x = 1] + +// Error: 2-3 unknown variable +{x} + --- // Multiple unseparated expressions in one line. diff --git a/tests/typ/style/wrap.typ b/tests/typ/style/wrap.typ index 5e0fdd0d..1ff3cc95 100644 --- a/tests/typ/style/wrap.typ +++ b/tests/typ/style/wrap.typ @@ -18,6 +18,12 @@ in booklovers and the great fulfiller of human need. // Test wrap in template. A [_B #wrap c in [*#c*]; C] D +--- +// Test wrap style precedence. +#set text(fill: eastern, size: 150%) +#wrap body in text(fill: forest, body) +Forest + --- // Error: 6-17 wrap is only allowed directly in markup {1 + wrap x in y} -- cgit v1.2.3