Clipboard: handle multiple CR+LF

This commit is contained in:
Kostiantyn Syrykh 2024-03-25 17:35:28 +02:00
parent 786aba602f
commit 9a1b1f0d06
2 changed files with 3 additions and 3 deletions

View File

@ -2356,7 +2356,7 @@ export default class RFB extends EventTargetMixin {
textData = textData.slice(0, -1);
}
textData = textData.replace("\r\n", "\n");
textData = textData.replaceAll("\r\n", "\n");
this.dispatchEvent(new CustomEvent(
"clipboard",

View File

@ -3263,11 +3263,11 @@ describe('Remote Frame Buffer Protocol Client', function () {
});
it('should update clipboard with correct escape characters from a Provide message ', function () {
let expectedData = "Oh\nmy!";
let expectedData = "Oh\nmy\n!";
let data = [3, 0, 0, 0];
const flags = [0x10, 0x00, 0x00, 0x01];
let text = encodeUTF8("Oh\r\nmy!\0");
let text = encodeUTF8("Oh\r\nmy\r\n!\0");
let deflatedText = deflateWithSize(text);