Update the toID method to collapse multiple whitespace characters to a single underscore
This commit is contained in:
parent
8c39374038
commit
0fcf24bfcb
1 changed files with 1 additions and 1 deletions
|
|
@ -8,6 +8,6 @@
|
|||
export function toID(text) {
|
||||
return text
|
||||
.toLowerCase()
|
||||
.replace(/\s/g, `_`)
|
||||
.replace(/\s+/g, `_`)
|
||||
.replace(/\W/g, ``);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue