Skip to content
This repository has been archived by the owner on Jan 31, 2018. It is now read-only.

Commit

Permalink
Merge pull request #16 from ajaxorg/master
Browse files Browse the repository at this point in the history
Proper escaping in text modules
  • Loading branch information
joewalker committed Nov 2, 2011
2 parents 32f24d2 + 375d9a3 commit 11ffb0e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/dryice/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -677,8 +677,8 @@ copy.filter.addDefines = function(input, source) {
source = source.path;
}

input = input.replace(/"/g, '\\"');
input = '"' + input.replace(/\n/g, '" +\n "') + '"';
input = input.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
input = '"' + input.replace(/\n/g, '\\n" +\n "') + '"';

return 'define("text!' + source.toString() + '", [], ' + input + ');\n\n';
};
Expand Down

0 comments on commit 11ffb0e

Please sign in to comment.