From 404cce0047b2e665c7c7092a993a891d1bfae055 Mon Sep 17 00:00:00 2001 From: Jacob Kim Date: Tue, 5 Aug 2025 17:47:07 -0700 Subject: [PATCH] fix: handle numbers as well --- core/util/text.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/util/text.ts b/core/util/text.ts index 434436c40..297bfd5c1 100644 --- a/core/util/text.ts +++ b/core/util/text.ts @@ -40,7 +40,7 @@ export function escapeForSVG(text: string): string { export function kebabOfStr(str: string): string { return str - .replace(/([a-z])([A-Z])/g, "$1-$2") // handle camelCase and PascalCase + .replace(/([a-z0-9])([A-Z])/g, "$1-$2") // handle camelCase, PascalCase, and numbers followed by uppercase .replace(/[\s_]+/g, "-") // replace spaces and underscores with hyphens .toLowerCase(); }