Navigation Menu

Skip to content

Commit

Permalink
Fixed filter text block exception reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Aug 2, 2010
1 parent 858c459 commit 86c94be
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/jade.js
Expand Up @@ -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 + '"');
}
Expand Down
6 changes: 4 additions & 2 deletions test/jade.test.js
Expand Up @@ -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);
},

Expand Down

0 comments on commit 86c94be

Please sign in to comment.