diff --git a/src/services/notes.js b/src/services/notes.js index b89755393..3e63dea8e 100644 --- a/src/services/notes.js +++ b/src/services/notes.js @@ -889,6 +889,10 @@ function scanForLinks(note, content) { * Things which have to be executed after updating content, but asynchronously (separate transaction) */ async function asyncPostProcessContent(note, content) { + if (note.hasStringContent() && !utils.isString(content)) { + content = content.toString(); + } + scanForLinks(note, content); } diff --git a/src/services/utils.js b/src/services/utils.js index a0a84e975..517d65ef9 100644 --- a/src/services/utils.js +++ b/src/services/utils.js @@ -303,6 +303,10 @@ function toMap(list, key) { return map; } +function isString(x) { + return Object.prototype.toString.call(x) === "[object String]"; +} + module.exports = { randomSecureToken, randomString, @@ -335,4 +339,5 @@ module.exports = { normalize, hashedBlobId, toMap, + isString };