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:
parent
2ac453139f
commit
277a3b244b
7
files.js
7
files.js
|
|
@ -318,11 +318,12 @@ var Images = {
|
||||||
},
|
},
|
||||||
|
|
||||||
addImagesFromClipboard: function(callback) {
|
addImagesFromClipboard: function(callback) {
|
||||||
Clipboard.get_text(CLIPBOARD_TYPE, (clipBoard, text) => {
|
Clipboard.get_text(CLIPBOARD_TYPE, (clipboard, text) => {
|
||||||
if (!text)
|
if (!text)
|
||||||
return;
|
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')
|
if (lines[0] == 'x-special/nautilus-clipboard')
|
||||||
lines = lines.slice(2);
|
lines = lines.slice(2);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue