mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-15 05:45:19 +00:00
refac/enh: allow underscore for prompt command
This commit is contained in:
parent
f1300a8fd9
commit
05895d9657
2 changed files with 4 additions and 4 deletions
|
|
@ -59,8 +59,8 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
const validateCommandString = (inputString) => {
|
const validateCommandString = (inputString) => {
|
||||||
// Regular expression to match only alphanumeric characters and hyphen
|
// Regular expression to match only alphanumeric characters, hyphen, and underscore
|
||||||
const regex = /^[a-zA-Z0-9-]+$/;
|
const regex = /^[a-zA-Z0-9-_]+$/;
|
||||||
|
|
||||||
// Test the input string against the regular expression
|
// Test the input string against the regular expression
|
||||||
return regex.test(inputString);
|
return regex.test(inputString);
|
||||||
|
|
|
||||||
|
|
@ -1389,8 +1389,8 @@ export const slugify = (str: string): string => {
|
||||||
.replace(/[\u0300-\u036f]/g, '')
|
.replace(/[\u0300-\u036f]/g, '')
|
||||||
// 3. Replace any sequence of whitespace with a single hyphen
|
// 3. Replace any sequence of whitespace with a single hyphen
|
||||||
.replace(/\s+/g, '-')
|
.replace(/\s+/g, '-')
|
||||||
// 4. Remove all characters except alphanumeric characters and hyphens
|
// 4. Remove all characters except alphanumeric characters, hyphens, and underscores
|
||||||
.replace(/[^a-zA-Z0-9-]/g, '')
|
.replace(/[^a-zA-Z0-9-_]/g, '')
|
||||||
// 5. Convert to lowercase
|
// 5. Convert to lowercase
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue