Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion dist/index1.js
Original file line number Diff line number Diff line change
Expand Up @@ -27398,7 +27398,8 @@ class OutputListener {
get contents () {
return this._buff
.map(chunk => chunk.toString())
.join('');
.join('')
.replace(/`/g, '\\`');
}
}

Expand Down
3 changes: 2 additions & 1 deletion wrapper/lib/output-listener.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ class OutputListener {
get contents () {
return this._buff
.map(chunk => chunk.toString())
.join('');
.join('')
.replace(/`/g, '\\`');
}
}

Expand Down
9 changes: 9 additions & 0 deletions wrapper/test/output-listener.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,13 @@ describe('output-listener', () => {
listen(Buffer.from('baz'));
expect(listener.contents).toEqual('foobarbaz');
});

it('escape backticks', () => {
const listener = new OutputListener();
const listen = listener.listener;
listen(Buffer.from('foo'));
listen(Buffer.from('`bar`'));
listen(Buffer.from('baz'));
expect(listener.contents).toEqual('foo\\`bar\\`baz');
});
});