Permalink
Browse files

Merge branch 'fix-reporting'

  • Loading branch information...
2 parents ac9601e + 86c94be commit 0b7632d6ab961acc1a12d6773c67ee0085a81d0b @tj tj committed Aug 2, 2010
Showing with 22 additions and 1 deletion.
  1. +1 −1 lib/jade.js
  2. +21 −0 test/jade.test.js
View
@@ -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
@@ -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)'));

0 comments on commit 0b7632d

Please sign in to comment.