Fixed slugify behavior.

This commit is contained in:
DebaucheryLibrarian
2026-01-10 04:33:15 +01:00
parent e84beacca1
commit 19dbd624ca
8 changed files with 77 additions and 41 deletions

View File

@@ -42,7 +42,7 @@ const accentMap = {
};
const plainCharRegex = /[a-zA-Z0-9]/;
const defaultPunctuationRegex = /[.,?!:;&'"“”…()[]{}<>\/*—]/;
const defaultPunctuationRegex = /[.,?!:;&'"“”…()[\]{}<>/*—]/;
const defaultSymbolRegex = /[@$€£#%^+=\\~]/;
function slugify(strings, delimiter = '-', {
@@ -50,7 +50,7 @@ function slugify(strings, delimiter = '-', {
lower = true,
encode = false,
accents: keepAccents = false,
punctuation: keepPunctuation = false,
punctuation: keepPunctuation = 'split',
punctuationRegex = defaultPunctuationRegex,
symbols: keepSymbols = false,
symbolRegex = defaultSymbolRegex,