Support dashes in template variable/fn names

This commit is contained in:
Gregory Schier
2025-01-13 06:38:21 -08:00
parent 8cd9c031e8
commit 88ff7f4300
2 changed files with 50 additions and 2 deletions

View File

@@ -159,7 +159,7 @@ const EnvironmentEditor = function ({
const validateName = useCallback((name: string) => {
// Empty just means the variable doesn't have a name yet, and is unusable
if (name === '') return true;
return name.match(/^[a-z_][a-z0-9_]*$/i) != null;
return name.match(/^[a-z][a-z0-9_-]*$/i) != null;
}, []);
return (