summaryrefslogtreecommitdiffstats
path: root/spec/tokenizer.js
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2015-08-14 15:18:52 -0500
committerkpdecker <kpdecker@gmail.com>2015-08-22 10:59:08 -0700
commit91ffd32cad32b2d1cd310ff94f65b28c428206ac (patch)
tree13cb346dfb0e6dc72dc6dddbcdf3ed8e61ebaeff /spec/tokenizer.js
parent2571dd8e8e43fd320672763564b16a5b3ae33966 (diff)
downloadhandlebars.js-91ffd32cad32b2d1cd310ff94f65b28c428206ac.zip
handlebars.js-91ffd32cad32b2d1cd310ff94f65b28c428206ac.tar.gz
handlebars.js-91ffd32cad32b2d1cd310ff94f65b28c428206ac.tar.bz2
Implement partial blocks
This allows for failover for missing partials as well as limited templating ability through the `{{> @partial-block }}` partial special case. Partial fix for #1018
Diffstat (limited to 'spec/tokenizer.js')
-rw-r--r--spec/tokenizer.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/tokenizer.js b/spec/tokenizer.js
index a474dfb..f170704 100644
--- a/spec/tokenizer.js
+++ b/spec/tokenizer.js
@@ -214,6 +214,10 @@ describe('Tokenizer', function() {
shouldMatchTokens(result, ['OPEN_PARTIAL', 'ID', 'SEP', 'ID', 'SEP', 'ID', 'CLOSE']);
});
+ it('tokenizes partial block declarations', function() {
+ var result = tokenize('{{#> foo}}');
+ shouldMatchTokens(result, ['OPEN_PARTIAL_BLOCK', 'ID', 'CLOSE']);
+ });
it('tokenizes a comment as "COMMENT"', function() {
var result = tokenize('foo {{! this is a comment }} bar {{ baz }}');
shouldMatchTokens(result, ['CONTENT', 'COMMENT', 'CONTENT', 'OPEN', 'ID', 'CLOSE']);