Skip to content

Commit

Permalink
better string escape (wip)
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrsh committed Mar 1, 2017
1 parent b4f5f57 commit 0e4585d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions dist/moon.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@
var escapeString = function (str) {
var NEWLINE_RE = /\n/g;
var DOUBLE_QUOTE_RE = /"/g;
var BACKSLASH_RE = /\\[^n]/g;
return str.replace(NEWLINE_RE, "\\n").replace(BACKSLASH_RE, "\\\\").replace(DOUBLE_QUOTE_RE, "\\\"");
var BACKSLASH_RE = /\\/g;
return str.replace(BACKSLASH_RE, "\\\\").replace(DOUBLE_QUOTE_RE, "\\\"").replace(NEWLINE_RE, "\\n");
};

/**
Expand Down
Loading

0 comments on commit 0e4585d

Please sign in to comment.