Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix: change tag in note if sanitized

thecodrr90223dc7c544
diff --git a/packages/core/collections/notes.js b/packages/core/collections/notes.js
index 3afeadeab..bc0baa6fb 100644
--- a/packages/core/collections/notes.js
+++ b/packages/core/collections/notes.js
@@ -37,8 +37,10 @@ export default class Notes extends Collection {
}
if (tags && tags.length) {
- for (let tag of tags) {
- await this._db.tags.add(tag, id);
+ for (let i = 0; i < tags.length; ++i) {
+ const tag = tags[i];
+ const addedTag = await this._db.tags.add(tag, id);
+ if (addedTag.title !== tag) tags[i] = addedTag.title;
}
}