A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
fix: word count is always +1 than the original value (#97)
Ammar Ahmed4a2156ec8b39
diff --git a/apps/web/src/utils/string.js b/apps/web/src/utils/string.jsindex d2e7f4752..f9a077735 100644--- a/apps/web/src/utils/string.js+++ b/apps/web/src/utils/string.js@@ -9,5 +9,7 @@ export function toTitleCase(str) {export function countWords(str) {str = str.trim();if (!str.length) return 0;- return str.split(/\W+\S/).length + (str[str.length] === " " ? 0 : 1);++ return str.split(/\W+\S/).length;}+