Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'fix-reporting'

  • Loading branch information...
commit 0b7632d6ab961acc1a12d6773c67ee0085a81d0b 2 parents ac9601e + 86c94be
@tj tj authored
Showing with 22 additions and 1 deletion.
  1. +1 −1  lib/jade.js
  2. +21 −0 test/jade.test.js
View
2  lib/jade.js
@@ -441,7 +441,7 @@ Parser.prototype = {
filter = filters[name];
if (filter) {
var text = interpolate(this.parseTextBlock().replace(/'/g, "\\'"));
- return "buf.push('" + filter(text) + "');";
+ return this._ + "buf.push('" + filter(text) + "');";
} else {
throw new Error('unknown filter ":' + name + '"');
}
View
21 test/jade.test.js
@@ -337,6 +337,27 @@ module.exports = {
err.message);
},
+ 'test filter text block exceptions': function(assert){
+ var err;
+ try {
+ render([
+ ':javascript',
+ ' | foo',
+ ' | bar',
+ ' | bar',
+ ' | bar',
+ ' | bar',
+ ' | #{baz}',
+ ' | raz'
+ ].join('\n'));
+ } catch (e) {
+ err = e;
+ }
+ assert.equal(
+ "Jade:8\n 6. ' | bar'\n 7. ' | #{baz}'\n 8. ' | raz'\n\nbaz is not defined",
+ err.message);
+ },
+
'test html 5 mode': function(assert){
assert.equal('<!DOCTYPE html><input type="checkbox" checked>', render('!!! 5\ninput(type="checkbox", checked)'));
assert.equal('<!DOCTYPE html><input type="checkbox" checked>', render('!!! 5\ninput(type="checkbox", checked: true)'));
Please sign in to comment.
Something went wrong with that request. Please try again.