Skip to content

Commit

Permalink
don't trim imported rows in order to correctly import word forms with…
Browse files Browse the repository at this point in the history
… empty values, #254
  • Loading branch information
klues committed Mar 11, 2024
1 parent 628806f commit b7273b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/vue-components/modals/editElementWordForms.vue
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
this.currentMsg = null;
this.msgCount = this.gridPasteCount = 0;
let result = await util.getClipboardContent();
let rows = result.split('\n').map(row => row.trim()).filter(row => !!row);
let rows = result.split('\n').filter(row => !!row);
let colNrValue = 0;
let colNrLang = 1;
let colNrTags = 2;
Expand All @@ -169,7 +169,7 @@
row[colNrTags] = row[colNrTags] ? row[colNrTags].split(",").map(tag => tag.trim().toLocaleUpperCase()).filter(tag => !!tag) : null;
return row;
});
rows = rows.filter(row => (!row[colNrLang] || row[colNrLang].length === 2) && row[colNrValue])
rows = rows.filter(row => (!row[colNrLang] || row[colNrLang].length === 2) && row[colNrValue]);
if (!rows.length) {
this.currentMsg = this.msgTypes.ERROR_PASTE;
return;
Expand Down

0 comments on commit b7273b8

Please sign in to comment.