Skip to content

Commit

Permalink
Fix issues with custom remove in slug config
Browse files Browse the repository at this point in the history
  • Loading branch information
paulpopus committed Feb 18, 2024
1 parent bbeba77 commit bd82b90
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
3 changes: 3 additions & 0 deletions dev/src/collections/SlugExamples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ const SlugExamples: CollectionConfig = {
{
useFields: ['title', 'subtitle'],
appendOnDuplication: true,
slugify: {
remove: /[*+~.()'"!?#\.,:@]/g,
},
},
),
...SlugField(
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nouance/payload-better-fields-plugin",
"version": "1.3.4",
"version": "1.3.5",
"homepage:": "https://github.com/NouanceLabs/payload-better-fields-plugin",
"repository": "[email protected]:NouanceLabs/payload-better-fields-plugin.git",
"description": "A Payload plugin that aims to provide improved fields for the admin panel",
Expand Down
12 changes: 5 additions & 7 deletions src/fields/Slug/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,11 @@ export const SlugField: Slug = (
},
},
) => {
const slugifyOptions: SlugifyOptions = deepMerge(
{
lower: true,
remove: /[*+~.()'"!?#\.,:@]/g,
},
config.slugify,
)
const slugifyOptions: SlugifyOptions = {
lower: true,
remove: /[*+~\/\\.()'"!?#\.,:@]/g,
...config.slugify,
}

const checkboxField = deepMerge(
{
Expand Down

0 comments on commit bd82b90

Please sign in to comment.