Permalink
Browse files

Fixed include escapes. Closes #513

  • Loading branch information...
1 parent 70b9269 commit 9d4b1310b6ba25bb5d321e033823261359630c93 @tj tj committed Mar 10, 2012
Showing with 9 additions and 2 deletions.
  1. +1 −0 lib/nodes/literal.js
  2. +3 −0 test/cases/aux/escapes.html
  3. +3 −1 test/cases/includes.html
  4. +2 −1 test/cases/includes.jade
@@ -20,6 +20,7 @@ var Node = require('./node');
var Literal = module.exports = function Literal(str) {
this.str = str
+ .replace(/\\/g, "\\\\")
.replace(/\n|\r\n/g, "\\n")
.replace(/'/g, "\\'");
};
@@ -0,0 +1,3 @@
+<script>
+ console.log("foo\nbar")
+</script>
@@ -1,4 +1,6 @@
<p>bar
</p>
-<body><p>:)</p>
+<body><p>:)</p><script>
+ console.log("foo\nbar")
+</script>
</body>
@@ -4,4 +4,5 @@ include aux/mixins
mixin foo()
body
- include aux/smile.html
+ include aux/smile.html
+ include aux/escapes.html

0 comments on commit 9d4b131

Please sign in to comment.