diff --git a/src/entities/note.js b/src/entities/note.js index c110479d3..739eec983 100644 --- a/src/entities/note.js +++ b/src/entities/note.js @@ -95,15 +95,16 @@ class Note extends Entity { this.content = ""; } } - - if (this.isStringNote()) { - this.content = this.content === null - ? "" - : this.content.toString("UTF-8"); - } } - return this.content; + if (this.isStringNote()) { + return this.content === null + ? "" + : this.content.toString("UTF-8"); + } + else { + return this.content; + } } /** @returns {Promise<*>} */ diff --git a/src/entities/note_revision.js b/src/entities/note_revision.js index 02a6ffa8e..3220107f1 100644 --- a/src/entities/note_revision.js +++ b/src/entities/note_revision.js @@ -89,15 +89,16 @@ class NoteRevision extends Entity { this.content = ""; } } - - if (this.isStringNote()) { - this.content = this.content === null - ? "" - : this.content.toString("UTF-8"); - } } - return this.content; + if (this.isStringNote()) { + return this.content === null + ? "" + : this.content.toString("UTF-8"); + } + else { + return this.content; + } } /** @returns {Promise} */ diff --git a/src/public/javascripts/services/utils.js b/src/public/javascripts/services/utils.js index f76b1dcb0..c7889e6af 100644 --- a/src/public/javascripts/services/utils.js +++ b/src/public/javascripts/services/utils.js @@ -256,6 +256,10 @@ function openDialog($dialog) { } function isHtmlEmpty(html) { + if (!html) { + return true; + } + html = html.toLowerCase(); return $("