summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Gonggrijp <dev@juliangonggrijp.com>2021-07-05 15:48:29 +0200
committerJulian Gonggrijp <dev@juliangonggrijp.com>2021-07-05 15:48:29 +0200
commit977b9e794af57d4dd8f28a8191ac3d38ca4c8224 (patch)
tree0c62f34fafb96e8e9f511f84bc1c628d2f873a6f
parentbb63070e701e6e5ba9fa0b4adaa259a0ef8115be (diff)
downloadmustache-spec-977b9e794af57d4dd8f28a8191ac3d38ca4c8224.tar.gz
Specify block scope resolution (#125)
-rw-r--r--specs/~inheritance.yml11
1 files changed, 11 insertions, 0 deletions
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: "{{<parent}}{{$block}}I say {{fruit}}.{{/block}}{{/parent}}"
+ partials:
+ parent: "{{#nested}}{{$block}}You say {{fruit}}.{{/block}}{{/nested}}"
+ expected: I say bananas.