From 20656170d0866c3da960dff76b264bef6a27f87c Mon Sep 17 00:00:00 2001 From: Samuel Janda Date: Sun, 14 Jan 2024 18:21:27 +1100 Subject: [PATCH] Address a bug in the word counter regex --- src/TextInput/TextInput.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TextInput/TextInput.svelte b/src/TextInput/TextInput.svelte index 411aaa33..ff704fc4 100644 --- a/src/TextInput/TextInput.svelte +++ b/src/TextInput/TextInput.svelte @@ -128,7 +128,7 @@ if (counter === "char") { count = value.length; } else if (counter === "word") { - count = value.split(/\b/).length - 1; + count = value.split(/\b\w+\b/).length - 1; } };