Skip to content

Build your personal knowledge base with Trilium Notes

filtering out initial <p>&nbsp;</p> which is ugly when switching to code

azivnerf3ccf852858b
diff --git a/services/notes.js b/services/notes.js
index 40fb5eb63e..0a0f90bb02 100644
--- a/services/notes.js
+++ b/services/notes.js
@@ -209,6 +209,10 @@ async function saveNoteImages(noteId, noteText, sourceId) {
}
async function updateNote(noteId, newNote, dataKey, sourceId) {
+ if (newNote.detail.note_text === '<p>&nbsp;</p>') {
+ newNote.detail.note_text = '';
+ }
+
if (newNote.detail.is_protected) {
await encryptNote(newNote, dataKey);
}