mirror of
https://github.com/open-webui/open-webui.git
synced 2026-12-05 11:07:55 -05:00
fix: improve international character handling in prompt commands
This commit is contained in:
1 parent
07d8460126
commit
9f8b94e45f
2 files changed
+26
-3
No files matched your search
@@ -1298,3 +1298,17 @@ export const convertOpenApiToToolPayload = (openApiSpec) => {
|
||||
|
||||
return toolPayload;
|
||||
};
|
||||
|
||||
export const slugify = (str: string): string => {
|
||||
return str
|
||||
// 1. Normalize: separate accented letters into base + combining marks
|
||||
.normalize("NFD")
|
||||
// 2. Remove all combining marks (the accents)
|
||||
.replace(/[\u0300-\u036f]/g, "")
|
||||
// 3. Replace any sequence of whitespace with a single hyphen
|
||||
.replace(/\s+/g, "-")
|
||||
// 4. Remove all characters except alphanumeric characters and hyphens
|
||||
.replace(/[^a-zA-Z0-9-]/g, "")
|
||||
// 5. Convert to lowercase
|
||||
.toLowerCase();
|
||||
};
|
||||
Reference in new issue
Block a user