Skip to content

Commit

Permalink
Pass test for unescaped character preceded by two escaped backslashes…
Browse files Browse the repository at this point in the history
… in string

This breaks another test though...

See #1575 (comment)
  • Loading branch information
josephfrazier committed May 10, 2017
1 parent 021dd17 commit 20dc94b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/printer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3861,7 +3861,7 @@ function makeString(rawContent, enclosingQuote) {

// Matches any unnecessarily escaped character.
// Adapted from https://github.com/eslint/eslint/blob/de0b4ad7bd820ade41b1f606008bea68683dc11a/lib/rules/no-useless-escape.js#L27
const regexUnnecessaryStringEscapes = /((?:\\\\)*)\\([^\\nrvtbfux\r\n\u2028\u2029"'0-7])/g;
const regexUnnecessaryStringEscapes = /((?:^|[^\\])(?:\\\\)*)\\([^\\nrvtbfux\r\n\u2028\u2029"'0-7])/g;

// Escape and unescape single and double quotes as needed to be able to
// enclose `rawContent` with `enclosingQuote`.
Expand Down

0 comments on commit 20dc94b

Please sign in to comment.