[FIX] modify regex to accept cyrillic characters in page name (#4741)
* modify regex to accept cyrillic characters in page name * Remove separator regex in order to allow all utf characters * Disallow special characters
This commit is contained in:
parent
50e5807e8d
commit
9d6247672a
|
|
@ -110,10 +110,12 @@ export const flashElementById = (id: string) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const resolveAsSpaceChar = (value: string, limit?: number) => {
|
export const resolveAsSpaceChar = (value: string, limit?: number) => {
|
||||||
const separatorRegex = /[^\w\s]/;
|
// ensures that all special characters are disallowed
|
||||||
|
// while allowing all utf-8 characters
|
||||||
|
const removeSpecialCharsRegex = /`|\~|\!|\@|\#|\$|\%|\^|\&|\*|\(|\)|\+|\=|\[|\{|\]|\}|\||\\|\'|\<|\,|\.|\>|\?|\/|\""|\;|\:|\s/;
|
||||||
const duplicateSpaceRegex = /\s+/;
|
const duplicateSpaceRegex = /\s+/;
|
||||||
return value
|
return value
|
||||||
.split(separatorRegex)
|
.split(removeSpecialCharsRegex)
|
||||||
.join(" ")
|
.join(" ")
|
||||||
.split(duplicateSpaceRegex)
|
.split(duplicateSpaceRegex)
|
||||||
.join(" ")
|
.join(" ")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user