Use the first character when formatting the -_- like name sequences
This commit is contained in:
parent
0e3962e110
commit
33a16bd629
1 changed files with 2 additions and 2 deletions
|
@ -72,8 +72,8 @@ function formatName(name: string): string {
|
|||
.replace(/[^a-zA-Z0-9_-]/g, "_")
|
||||
// remove trailing '-_' characters
|
||||
.replace(/^[-_]+|[-_]+$/g, "")
|
||||
// remove duplicated '-_' characters
|
||||
.replace(/([-_])*/g, "$1");
|
||||
// remove duplicated '-_' character sequences
|
||||
.replace(/([-_])([-_])+/g, "$1");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue