Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
escape double quotes in string values: fixes microsoft/vscode#10666
Browse files Browse the repository at this point in the history
  • Loading branch information
weinand committed Aug 19, 2016
1 parent 6230ba8 commit 468887b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/node/nodeDebug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2627,7 +2627,13 @@ export class NodeDebugSession extends DebugSession {

private _createStringVariable2(name, s: string) {
if (s) {
s = s.replace('\n', '\\n').replace('\r', '\\r');
s = s.replace(/\n|\r|\"/g, x => {
switch (x) {
case '\n': return '\\n';
case '\r': return '\\r';
case '\"': return '\\"';
}
});
}
return new Variable(name, `"${s}"`);
}
Expand Down

0 comments on commit 468887b

Please sign in to comment.