Skip to content

Commit

Permalink
Improve suglify list label to create default id
Browse files Browse the repository at this point in the history
  • Loading branch information
seballot committed Jul 26, 2024
1 parent dcada90 commit cf8c7d9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tools/bazar/presentation/javascripts/list-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ export default {
},
slugify(val) {
return val.normalize('NFD').replace(/[\u0300-\u036f]/g, '')
.replace(/[^a-z^A-Z^_^0-9^{^}]/g, '_')
.replace(/[^a-z^A-Z^_^0-9^{^}]/g, '_') // "test !" => "test__"
.replace(/_+/g, '_') // "te__st" => "te_st"
.replace(/^_+|_+$/g, '') // "___test__" => "test"
.toLowerCase()
}
},
Expand Down

0 comments on commit cf8c7d9

Please sign in to comment.