mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-11-23 03:26:36 +03:00
Allow underscore on slugify
This commit is contained in:
parent
dcd6391c88
commit
2f62bad734
@ -35,6 +35,10 @@ describe.concurrent('branch slugify with valid characters', () => {
|
||||
test('numbers are fine', () => {
|
||||
expect(slugify('my/branch1')).toEqual('my/branch1');
|
||||
});
|
||||
|
||||
test('underscores are fine', () => {
|
||||
expect(slugify('my_branch')).toEqual('my_branch');
|
||||
});
|
||||
});
|
||||
|
||||
describe.concurrent('branch slugify with replaced characters', () => {
|
||||
|
@ -44,7 +44,7 @@ export function slugify(input: string) {
|
||||
.normalize('NFKD')
|
||||
.replace(/[\u0300-\u036f]/g, '')
|
||||
.trim()
|
||||
.replace(/[^A-Za-z0-9/ -]/g, '')
|
||||
.replace(/[^A-Za-z0-9_/ -]/g, '')
|
||||
.replace(/\s+/g, '-')
|
||||
.replace(/-+/g, '-');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user