diff --git a/apps/masterbots.ai/lib/url.ts b/apps/masterbots.ai/lib/url.ts index 96fd0202..53eed92c 100644 --- a/apps/masterbots.ai/lib/url.ts +++ b/apps/masterbots.ai/lib/url.ts @@ -9,8 +9,8 @@ export const SlugSchema: ZodSchema = z.string() export const toSlug = (username: string, separator: string): string => { return username .toLowerCase() - .replace(/&/g, '_') - .replace(/ & /g, '_') + .replace(/&/g, 'n') + .replace(/ & /g, 'n') .replace(/[^a-z0-9_]/g, separator) } diff --git a/packages/mb-lib/src/text/text.lib.ts b/packages/mb-lib/src/text/text.lib.ts index 6aec61c6..37f545d6 100644 --- a/packages/mb-lib/src/text/text.lib.ts +++ b/packages/mb-lib/src/text/text.lib.ts @@ -10,9 +10,9 @@ export function toSlug(str: string): string { return ""; } s = s.toLowerCase().trim(); - s = s.replace(/ & /g, " and "); - s = s.replace(/[ ]+/g, "-"); - s = s.replace(/[-]+/g, "-"); - s = s.replace(/[^a-z0-9-]+/g, ""); + s = s.replace(/\&/g, "n"); + s = s.replace(/[ ]+/g, "_"); + s = s.replace(/[-]+/g, "_"); + s = s.replace(/[^a-z0-9_]+/g, ""); return s; }