Cybrkyd's Git Repositories

jottings - commit: 0236fc0

commit 0236fc0cd9d4044469652eba5966a72dfff83348d19d077947716f9f4271fc11
author Cybrkyd <git@cybrkyd.com> 2026-06-24 09:56:47 +0100
committer Cybrkyd <git@cybrkyd.com> 2026-06-24 09:56:47 +0100

Commit Message

Exclude punctuation from word count

📊 Diffstat

resources/js/app.js 2
1 files changed, 1 insertions(+), 1 deletions(-)

Diff

diff --git a/resources/js/app.js b/resources/js/app.js
index 7762477..2493962 100644
--- a/resources/js/app.js
+++ b/resources/js/app.js
@@ -813,7 +813,7 @@ async function exportDocument() {
// COUNTS & STATUS
function updateCounts(text) {
const characters = text.length;
- const words = text.trim().split(/\s+/).filter(Boolean).length;
+ const words = (text.match(/\S*[A-Za-z0-9\u00C0-\u024F]\S*/g) || []).length;
const formatter = new Intl.NumberFormat('en-GB');
document.getElementById("charCount").textContent =