From 50f3c1300aa9b21d53c0d3486c4a89704c8f9504 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Perrin?= Date: Fri, 8 Dec 2023 09:56:22 +0900 Subject: [PATCH] keep leading spaces when pasting multi-line text --- src/chats.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/chats.js b/src/chats.js index fe1e4a93..0ba30bef 100755 --- a/src/chats.js +++ b/src/chats.js @@ -7839,6 +7839,8 @@ define("xabber-chats", function () { arr_text.forEach((item, idx) => { if (item == '\n') arr_text.splice(idx, 1, '
'); + if (item == ' ') + arr_text.splice(idx, 1, ' '); }); text = "

" + arr_text.join("").emojify({tag_name: 'span'}) + "

"; window.document.execCommand('insertHTML', false, text); @@ -7851,7 +7853,7 @@ define("xabber-chats", function () { if (item == '\n') arr_text.splice(idx, 1, '
'); if (item == ' ') - arr_text.splice(idx, 1, ' '); + arr_text.splice(idx, 1, ' '); }); text = "

" + arr_text.join("").emojify({tag_name: 'span'}) + "

"; window.document.execCommand('insertHTML', false, text);