fix wordcount

This commit is contained in:
2023-05-01 00:51:41 +02:00
parent 977e146b31
commit 9fea397f55

View File

@@ -10,7 +10,7 @@ export const notes = computed<Note[]>(() => {
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[]
})