From 977b9e794af57d4dd8f28a8191ac3d38ca4c8224 Mon Sep 17 00:00:00 2001 From: Julian Gonggrijp Date: Mon, 5 Jul 2021 15:48:29 +0200 Subject: Specify block scope resolution (#125) --- specs/~inheritance.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/specs/~inheritance.yml b/specs/~inheritance.yml index 07fa081..5a24ba8 100644 --- a/specs/~inheritance.yml +++ b/specs/~inheritance.yml @@ -224,3 +224,14 @@ tests: partials: parent: "{{$foo}}default content{{/foo}}" expected: default content + + - name: Block scope + desc: Scope of a substituted block is evaluated in the context of the parent template + data: + fruit: apples + nested: + fruit: bananas + template: "{{ Date: Mon, 5 Jul 2021 16:13:50 +0200 Subject: Update JSON accordingly --- specs/~inheritance.json | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/specs/~inheritance.json b/specs/~inheritance.json index fedb34b..0a6878b 100644 --- a/specs/~inheritance.json +++ b/specs/~inheritance.json @@ -230,6 +230,21 @@ "parent": "{{$foo}}default content{{/foo}}" }, "expected": "default content" + }, + { + "name": "Block scope", + "desc": "Scope of a substituted block is evaluated in the context of the parent template", + "data": { + "fruit": "apples", + "nested": { + "fruit": "bananas" + } + }, + "template": "{{