Permalink
Browse files

Fixed filter text block exception reporting

  • Loading branch information...
tj committed Aug 2, 2010
1 parent 858c459 commit 86c94be2467ed793b0677cc36ee51eadfe86ff60
Showing with 5 additions and 3 deletions.
  1. +1 −1 lib/jade.js
  2. +4 −2 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
@@ -344,15 +344,17 @@ module.exports = {
':javascript',
' | foo',
' | bar',
+ ' | bar',
+ ' | bar',
+ ' | bar',
' | #{baz}',
' | raz'
].join('\n'));
} catch (e) {
err = e;
}
- console.log(err.message);
assert.equal(
- "Jade:5\n 2. ' | foo'\n 3. ' | bar'\n 4. ' | #{baz}'\n\nbaz is not defined",
+ "Jade:8\n 6. ' | bar'\n 7. ' | #{baz}'\n 8. ' | raz'\n\nbaz is not defined",
err.message);
},

0 comments on commit 86c94be

Please sign in to comment.