forked from Mirrors/gomuks
web/roomlist: lowercase search queries before unhomoglyphing
This commit is contained in:
parent
c0a8deb347
commit
251c91490c
1 changed files with 1 additions and 2 deletions
|
@ -46,8 +46,7 @@ export interface RoomListEntry {
|
||||||
const removeHiddenCharsRegex = /[\u2000-\u200F\u202A-\u202F\u0300-\u036F\uFEFF\u061C\u2800\u2062-\u2063\s]/g
|
const removeHiddenCharsRegex = /[\u2000-\u200F\u202A-\u202F\u0300-\u036F\uFEFF\u061C\u2800\u2062-\u2063\s]/g
|
||||||
|
|
||||||
export function toSearchableString(str: string): string {
|
export function toSearchableString(str: string): string {
|
||||||
return unhomoglyph(str.normalize("NFD").replace(removeHiddenCharsRegex, ""))
|
return unhomoglyph(str.normalize("NFD").toLowerCase().replace(removeHiddenCharsRegex, ""))
|
||||||
.toLowerCase()
|
|
||||||
.replace(/[\\'!"#$%&()*+,\-./:;<=>?@[\]^_`{|}~\u2000-\u206f\u2e00-\u2e7f]/g, "")
|
.replace(/[\\'!"#$%&()*+,\-./:;<=>?@[\]^_`{|}~\u2000-\u206f\u2e00-\u2e7f]/g, "")
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue