Index: third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js |
diff --git a/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js b/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js |
index 3e8c48459315aeac5e765d59755ca51643fb8c3e..e0a5940f50e1f75ac4b6fcd15deec8ffbbe00843 100644 |
--- a/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js |
+++ b/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js |
@@ -1377,10 +1377,13 @@ WebInspector.NetworkLogView.prototype = { |
Replace new line outside of quotes since cmd.exe doesn't let |
to do it inside. |
*/ |
- return "\"" + str.replace(/"/g, "\"\"") |
- .replace(/%/g, "\"%\"") |
- .replace(/\\/g, "\\\\") |
- .replace(/[\r\n]+/g, "\"^$&\"") + "\""; |
+ var encapsChars = /[\r\n]/.test(str) ? "^\"" : "\""; |
lushnikov
2016/07/27 20:16:18
are you sure you want to have /[\r\n]/ and not /\r
allada
2016/07/27 22:27:59
This is simply checking to see if there are any ne
|
+ return encapsChars + str.replace(/\\/g, "\\\\") |
+ .replace(/"/g, "\\\"") |
+ .replace(/\^/g, "^^") |
+ .replace(/[^a-zA-Z0-9\s_\-:=+~'^\/.',?;()*`]/g, "^$&") |
+ .replace(/%(?=[a-zA-Z0-9_])/g, "%^") |
+ .replace(/\r\n|[\n\r]/g, "^\n\n") + encapsChars; |
} |
function escapeStringPosix(str) |