Skip to content

Commit

Permalink
Test for windows specific newlines
Browse files Browse the repository at this point in the history
  • Loading branch information
thymikee committed Aug 4, 2017
1 parent f88ff88 commit 5c3e152
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/pretty-format/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function printBasicValue(
return printNumber(val);
}
if (typeOf === 'string') {
return /\n/.test(val)
return /\r\n|\n|\r/g.test(val)
? '`' + val.replace(/\\/g, '\\$&') + '`'
: '"' + val.replace(/"|\\/g, '\\$&') + '"';
}
Expand Down

0 comments on commit 5c3e152

Please sign in to comment.