trim clipboad text lines

Since 3.38 there is a line terminator character, that has to be removed with .trim().
This commit is contained in:
abakkk 2020-09-18 11:04:24 +02:00
parent 2ac453139f
commit 277a3b244b
1 changed files with 4 additions and 3 deletions

View File

@ -318,11 +318,12 @@ var Images = {
},
addImagesFromClipboard: function(callback) {
Clipboard.get_text(CLIPBOARD_TYPE, (clipBoard, text) => {
Clipboard.get_text(CLIPBOARD_TYPE, (clipboard, text) => {
if (!text)
return;
let lines = text.split('\n');
// Since 3.38 there is a line terminator character, that has to be removed with .trim().
let lines = text.split('\n').map(line => line.trim());
if (lines[0] == 'x-special/nautilus-clipboard')
lines = lines.slice(2);