From 9fea397f55bd4d7f94817368e9d431e40baa363e Mon Sep 17 00:00:00 2001 From: Marco Crapts Date: Mon, 1 May 2023 00:51:41 +0200 Subject: [PATCH] fix wordcount --- src/composables/useNotes.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/composables/useNotes.ts b/src/composables/useNotes.ts index 4375132..e677cfc 100644 --- a/src/composables/useNotes.ts +++ b/src/composables/useNotes.ts @@ -10,7 +10,7 @@ export const notes = computed(() => { return Object.entries(baseNotes) .map(([_, note]) => ({ ...note, - wordCount: note.content.split(' ').length - 1, + wordCount: note.content.split(' ').filter((word) => word.length > 0).length, })) .sort((a, b) => b.modified - a.modified) as Note[] })