Fix search
Fix regex expression to match all languages
This commit is contained in:
parent
a0664eecd2
commit
3fe47fd174
1 changed files with 11 additions and 11 deletions
|
@ -1862,10 +1862,10 @@ const app = new Vue({
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove any non-alphanumeric characters and spaces from search term and item name
|
// remove any non-alphanumeric characters and spaces from search term and item name
|
||||||
searchTerm = searchTerm.replace(/[^a-z0-9 ]/gi, "")
|
searchTerm = searchTerm.replace(/[^\p{L}\p{N}]/gu, "")
|
||||||
itemName = itemName.replace(/[^a-z0-9 ]/gi, "")
|
itemName = itemName.replace(/[^\p{L}\p{N}]/gu, "")
|
||||||
artistName = artistName.replace(/[^a-z0-9 ]/gi, "")
|
artistName = artistName.replace(/[^\p{L}\p{N}]/gu, "")
|
||||||
albumName = albumName.replace(/[^a-z0-9 ]/gi, "")
|
albumName = albumName.replace(/[^\p{L}\p{N}]/gu, "")
|
||||||
|
|
||||||
if (itemName.includes(searchTerm) || artistName.includes(searchTerm) || albumName.includes(searchTerm)) {
|
if (itemName.includes(searchTerm) || artistName.includes(searchTerm) || albumName.includes(searchTerm)) {
|
||||||
return item
|
return item
|
||||||
|
@ -1931,10 +1931,10 @@ const app = new Vue({
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove any non-alphanumeric characters and spaces from search term and item name
|
// remove any non-alphanumeric characters and spaces from search term and item name
|
||||||
searchTerm = searchTerm.replace(/[^a-z0-9 ]/gi, "")
|
searchTerm = searchTerm.replace(/[^\p{L}\p{N}]/gu, "")
|
||||||
itemName = itemName.replace(/[^a-z0-9 ]/gi, "")
|
itemName = itemName.replace(/[^\p{L}\p{N}]/gu, "")
|
||||||
artistName = artistName.replace(/[^a-z0-9 ]/gi, "")
|
artistName = artistName.replace(/[^\p{L}\p{N}]/gu, "")
|
||||||
albumName = albumName.replace(/[^a-z0-9 ]/gi, "")
|
albumName = albumName.replace(/[^\p{L}\p{N}]/gu, "")
|
||||||
|
|
||||||
if (itemName.includes(searchTerm) || artistName.includes(searchTerm) || albumName.includes(searchTerm)) {
|
if (itemName.includes(searchTerm) || artistName.includes(searchTerm) || albumName.includes(searchTerm)) {
|
||||||
return item
|
return item
|
||||||
|
@ -1996,8 +1996,8 @@ const app = new Vue({
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// remove any non-alphanumeric characters and spaces from search term and item name
|
// remove any non-alphanumeric characters and spaces from search term and item name
|
||||||
searchTerm = searchTerm.replace(/[^a-z0-9 ]/gi, "")
|
searchTerm = searchTerm.replace(/[^\p{L}\p{N}]/gu, "")
|
||||||
itemName = itemName.replace(/[^a-z0-9 ]/gi, "")
|
itemName = itemName.replace(/[^\p{L}\p{N}]/gu, "")
|
||||||
|
|
||||||
|
|
||||||
if (itemName.includes(searchTerm) || artistName.includes(searchTerm) || albumName.includes(searchTerm)) {
|
if (itemName.includes(searchTerm) || artistName.includes(searchTerm) || albumName.includes(searchTerm)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue