diff --git a/src/photo/db/index.ts b/src/photo/db/index.ts index 4c3a8063..e4f180cb 100644 --- a/src/photo/db/index.ts +++ b/src/photo/db/index.ts @@ -11,6 +11,7 @@ const DB_PARAMETERIZE_REPLACEMENTS = [ [',', ''], ['/', ''], ['+', '-'], + ['|', '-'], [' ', '-'], ]; diff --git a/src/utility/string.ts b/src/utility/string.ts index 46dd4527..99b49204 100644 --- a/src/utility/string.ts +++ b/src/utility/string.ts @@ -22,10 +22,10 @@ export const parameterize = ( ) => string .trim() - // Replace spaces, underscores, slashes, pluses, dashes with dashes - .replaceAll(/[\s_–—+]/gi, '-') + // Replace spaces, underscores, slashes, pluses, pipes, dashes with dashes + .replaceAll(/[\s_–—+|]/gi, '-') // Remove punctuation - .replaceAll(/['"!@#$%^&*()=[\]{};:/?,<>\\/|`~]/gi, '') + .replaceAll(/['"!@#$%^&*()=[\]{};:/?,<>\\/`~]/gi, '') // Removes non-alphanumeric characters, if configured .replaceAll( shouldRemoveNonAlphanumeric