Permalink
Browse files

fix escaping of interpolation. Closes #769

dont include the slash...
  • Loading branch information...
1 parent 1c0ceb5 commit 77f0e74db9c04d52b323beb2836e9ce1e0d86af0 @tj tj committed Sep 18, 2012
Showing with 11 additions and 1 deletion.
  1. +1 −1 lib/utils.js
  2. +5 −0 test/cases/interpolation.escape.html
  3. +5 −0 test/cases/interpolation.escape.jade
View
@@ -16,7 +16,7 @@
var interpolate = exports.interpolate = function(str){
return str.replace(/(\\)?([#!]){(.*?)}/g, function(str, escape, flag, code){
return escape
- ? str
+ ? str.slice(1)
: "' + "
+ ('!' == flag ? '' : 'escape')
+ "((interp = " + code.replace(/\\'/g, "'")
@@ -0,0 +1,5 @@
+<foo>
+ some
+ #{text}
+ here
+</foo>
@@ -0,0 +1,5 @@
+
+foo
+ | some
+ | \#{text}
+ | here

0 comments on commit 77f0e74

Please sign in to comment.