Skip to content

Commit c58aad7

Browse files
committed
fix replaceNewLines()
1 parent fd0cda0 commit c58aad7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gateway.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ var openPort = (function f(reopen) {
8686
})();
8787

8888
global.caseInsensitiveSorter = function (a, b) {return a.toLowerCase().localeCompare(b.toLowerCase())};
89-
String.prototype.replaceNewlines = function () { return this.replace('\n','\\n').replace('\r','\\r') };
89+
String.prototype.replaceNewlines = function () { return this.replace(/(?:\r\n|\r|\n)/g, '\\n') };
9090

9191
var merge = require('merge');
9292
global.loadMetricsFile = function(file, globalizeFunctions, fatal) {

0 commit comments

Comments
 (0)