diff --git a/src/parser.js b/src/parser.js index 61668c17..252bf4bf 100644 --- a/src/parser.js +++ b/src/parser.js @@ -192,9 +192,9 @@ var Parser = Object.extend({ var node = new nodeType(tag.lineno, tag.colno); node.template = this.parsePrimary(); - if(!((node.template instanceof nodes.Literal || - node.template instanceof nodes.Value) && - lib.isString(node.template.value))) { + if(!(node.template instanceof nodes.Literal && + lib.isString(node.template.value)) && + !(node.template instanceof nodes.Symbol)) { this.fail('parseExtends: string or value expected'); } diff --git a/tests/test.js b/tests/test.js index dee3ab99..30da4559 100644 --- a/tests/test.js +++ b/tests/test.js @@ -585,6 +585,10 @@ describe('compiler', function() { '{% block block1 %}BAR{% endblock %}' + '{% block block2 %}BAZ{% endblock %}'); s.should.equal('FooBARBAZFizzle'); + + s = render('hola {% extends tmpl %} hizzle mumble', + { tmpl: 'base.html' }); + s.should.equal('FooBarBazFizzle'); }); it('should render parent blocks with super()', function() { @@ -601,9 +605,8 @@ describe('compiler', function() { { name: 'james' }); s.should.equal('hello world FooInclude james'); - - s = render('hello world {% include templ %}', - { name: 'thedude', templ: "include.html" }); + s = render('hello world {% include tmpl %}', + { name: 'thedude', tmpl: "include.html" }); s.should.equal('hello world FooInclude thedude'); });