diff --git a/libs/importer/src/importers/base-importer.ts b/libs/importer/src/importers/base-importer.ts index f8acb5e0643..7196a83783a 100644 --- a/libs/importer/src/importers/base-importer.ts +++ b/libs/importer/src/importers/base-importer.ts @@ -319,8 +319,6 @@ export abstract class BaseImporter { } if (this.isNullOrWhitespace(cipher.notes)) { cipher.notes = null; - } else { - cipher.notes = cipher.notes.trim(); } } diff --git a/libs/importer/src/importers/enpass/enpass-json-importer.ts b/libs/importer/src/importers/enpass/enpass-json-importer.ts index e863e9b1666..83645d8f304 100644 --- a/libs/importer/src/importers/enpass/enpass-json-importer.ts +++ b/libs/importer/src/importers/enpass/enpass-json-importer.ts @@ -64,7 +64,10 @@ export class EnpassJsonImporter extends BaseImporter implements Importer { } } - cipher.notes += "\n" + this.getValueOrDefault(item.note, ""); + const note = this.getValueOrDefault(item.note, ""); + if (note) { + cipher.notes = note.trimEnd(); + } this.convertToNoteIfNeeded(cipher); this.cleanupCipher(cipher); result.ciphers.push(cipher); diff --git a/libs/importer/src/importers/keeper/keeper-csv-importer.ts b/libs/importer/src/importers/keeper/keeper-csv-importer.ts index 6c265ac31f5..9f86b4a66f4 100644 --- a/libs/importer/src/importers/keeper/keeper-csv-importer.ts +++ b/libs/importer/src/importers/keeper/keeper-csv-importer.ts @@ -21,7 +21,7 @@ export class KeeperCsvImporter extends BaseImporter implements Importer { const notes = this.getValueOrDefault(value[5]); if (notes) { - cipher.notes = `${notes}\n`; + cipher.notes = notes.trimEnd(); } cipher.name = this.getValueOrDefault(value[1], "--"); diff --git a/libs/importer/src/importers/myki-csv-importer.ts b/libs/importer/src/importers/myki-csv-importer.ts index 1180e2fbee1..07bf6a11b63 100644 --- a/libs/importer/src/importers/myki-csv-importer.ts +++ b/libs/importer/src/importers/myki-csv-importer.ts @@ -50,7 +50,7 @@ export class MykiCsvImporter extends BaseImporter implements Importer { results.forEach((value) => { const cipher = this.initLoginCipher(); cipher.name = this.getValueOrDefault(value.nickname, "--"); - cipher.notes = this.getValueOrDefault(value.additionalInfo); + cipher.notes = this.getValueOrDefault(value.additionalInfo, "").trimEnd(); if (value.url !== undefined) { // Accounts @@ -132,7 +132,7 @@ export class MykiCsvImporter extends BaseImporter implements Importer { cipher.secureNote = new SecureNoteView(); cipher.type = CipherType.SecureNote; cipher.secureNote.type = SecureNoteType.Generic; - cipher.notes = this.getValueOrDefault(value.content); + cipher.notes = this.getValueOrDefault(value.content, "").trimEnd(); this.importUnmappedFields(cipher, value, _mappedUserNoteColumns); } else { diff --git a/libs/importer/src/importers/netwrix/netwrix-passwordsecure-csv-importer.ts b/libs/importer/src/importers/netwrix/netwrix-passwordsecure-csv-importer.ts index 6cc31e78461..acdba76e986 100644 --- a/libs/importer/src/importers/netwrix/netwrix-passwordsecure-csv-importer.ts +++ b/libs/importer/src/importers/netwrix/netwrix-passwordsecure-csv-importer.ts @@ -35,7 +35,7 @@ export class NetwrixPasswordSecureCsvImporter extends BaseImporter implements Im const notes = this.getValueOrDefault(row.Informationen); if (notes) { - cipher.notes = `${notes}\n`; + cipher.notes = notes.trimEnd(); } cipher.name = this.getValueOrDefault(row.Beschreibung, "--"); diff --git a/libs/importer/src/importers/onepassword/onepassword-1pux-importer.ts b/libs/importer/src/importers/onepassword/onepassword-1pux-importer.ts index d19b5e7d0f3..4571a6957c4 100644 --- a/libs/importer/src/importers/onepassword/onepassword-1pux-importer.ts +++ b/libs/importer/src/importers/onepassword/onepassword-1pux-importer.ts @@ -97,7 +97,7 @@ export class OnePassword1PuxImporter extends BaseImporter implements Importer { this.processSections(category, item.details.sections, cipher); if (!this.isNullOrWhitespace(item.details.notesPlain)) { - cipher.notes = item.details.notesPlain.split(this.newLineRegex).join("\n") + "\n"; + cipher.notes = item.details.notesPlain.split(this.newLineRegex).join("\n").trimEnd(); } this.convertToNoteIfNeeded(cipher);