Fix page name special character bug (#1035)
* Fix page name special character bug * update fix page name special character bug * fix page name ending space
This commit is contained in:
parent
4e99ab7ace
commit
f5adc5732b
|
|
@ -102,9 +102,12 @@ export const flashElementById = (id: string) => {
|
|||
};
|
||||
|
||||
export const resolveAsSpaceChar = (value: string, limit?: number) => {
|
||||
const separatorRegex = /[\W_]+/;
|
||||
const separatorRegex = /[^\w\s]/;
|
||||
const duplicateSpaceRegex = /\s+/;
|
||||
return value
|
||||
.split(separatorRegex)
|
||||
.join("")
|
||||
.split(duplicateSpaceRegex)
|
||||
.join(" ")
|
||||
.slice(0, limit || 30);
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user