Skip to content

Commit

Permalink
fixed escape issue
Browse files Browse the repository at this point in the history
  • Loading branch information
cstivers78 committed Jan 13, 2012
1 parent ca4ed8b commit 41c1eca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/writer.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = class Writer
@buffer.push code

text: (text) ->
text = text.replace(/\n/g,'\\n').replace(/"/g,'\\"').replace(/'/g,"\\'")
text = text.replace(/\\/g,'\\\\').replace(/\n/g,'\\n').replace(/"/g,'\\"').replace(/'/g,"\\'")
@buffer.push 'write("'
@buffer.push text
@buffer.push '");\n'
Expand Down

0 comments on commit 41c1eca

Please sign in to comment.