summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Gonggrijp <dev@juliangonggrijp.com>2021-07-05 16:13:50 +0200
committerroot <root@delphi.lan>2022-08-08 21:08:57 +0200
commit4d6505fd966558c1bd0948847f68f38d8c952299 (patch)
treec707afc51d35c022ccc75d5761af5d49754b8d01
parent7a4d919d9dc43453524477470a4f217d11b94e24 (diff)
downloadmustache-spec-4d6505fd966558c1bd0948847f68f38d8c952299.tar.gz
Update JSON accordingly
-rw-r--r--specs/~inheritance.json15
1 files changed, 15 insertions, 0 deletions
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": "{{<parent}}{{$block}}I say {{fruit}}.{{/block}}{{/parent}}",
+ "partials": {
+ "parent": "{{#nested}}{{$block}}You say {{fruit}}.{{/block}}{{/nested}}"
+ },
+ "expected": "I say bananas."
}
]
}