summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Gonggrijp <dev@juliangonggrijp.com>2021-07-05 15:48:29 +0200
committerroot <root@delphi.lan>2022-08-08 21:08:57 +0200
commit7a4d919d9dc43453524477470a4f217d11b94e24 (patch)
treef3c99fbbc755ae260f5934605393d697d0f2d4bc
parentd17d6885f9b58b0faed4f5270b0e11e7eab34928 (diff)
downloadmustache-spec-7a4d919d9dc43453524477470a4f217d11b94e24.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.