This commit is contained in:
Manabu Sakai 2024-05-06 10:12:10 -04:00 committed by GitHub
commit d31c174c4b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 13 additions and 2 deletions

3
dist/index1.js vendored
View file

@ -27613,7 +27613,8 @@ class OutputListener {
get contents () {
return this._buff
.map(chunk => chunk.toString())
.join('');
.join('')
.replace(/`/g, '\\`');
}
}

View file

@ -34,7 +34,8 @@ class OutputListener {
get contents () {
return this._buff
.map(chunk => chunk.toString())
.join('');
.join('')
.replace(/`/g, '\\`');
}
}

View file

@ -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');
});
});