From 3fe47fd174f76fd8343365fccac0f2cd59e16707 Mon Sep 17 00:00:00 2001 From: h0ckerman <35598335+h0ckerman@users.noreply.github.com> Date: Sun, 13 Mar 2022 15:24:29 +0300 Subject: [PATCH] Fix search Fix regex expression to match all languages --- src/renderer/main/vueapp.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/renderer/main/vueapp.js b/src/renderer/main/vueapp.js index 3d3a3572..9c6a2969 100644 --- a/src/renderer/main/vueapp.js +++ b/src/renderer/main/vueapp.js @@ -1862,10 +1862,10 @@ const app = new Vue({ } // remove any non-alphanumeric characters and spaces from search term and item name - searchTerm = searchTerm.replace(/[^a-z0-9 ]/gi, "") - itemName = itemName.replace(/[^a-z0-9 ]/gi, "") - artistName = artistName.replace(/[^a-z0-9 ]/gi, "") - albumName = albumName.replace(/[^a-z0-9 ]/gi, "") + searchTerm = searchTerm.replace(/[^\p{L}\p{N}]/gu, "") + itemName = itemName.replace(/[^\p{L}\p{N}]/gu, "") + artistName = artistName.replace(/[^\p{L}\p{N}]/gu, "") + albumName = albumName.replace(/[^\p{L}\p{N}]/gu, "") if (itemName.includes(searchTerm) || artistName.includes(searchTerm) || albumName.includes(searchTerm)) { return item @@ -1931,10 +1931,10 @@ const app = new Vue({ } // remove any non-alphanumeric characters and spaces from search term and item name - searchTerm = searchTerm.replace(/[^a-z0-9 ]/gi, "") - itemName = itemName.replace(/[^a-z0-9 ]/gi, "") - artistName = artistName.replace(/[^a-z0-9 ]/gi, "") - albumName = albumName.replace(/[^a-z0-9 ]/gi, "") + searchTerm = searchTerm.replace(/[^\p{L}\p{N}]/gu, "") + itemName = itemName.replace(/[^\p{L}\p{N}]/gu, "") + artistName = artistName.replace(/[^\p{L}\p{N}]/gu, "") + albumName = albumName.replace(/[^\p{L}\p{N}]/gu, "") if (itemName.includes(searchTerm) || artistName.includes(searchTerm) || albumName.includes(searchTerm)) { return item @@ -1996,8 +1996,8 @@ const app = new Vue({ // } // remove any non-alphanumeric characters and spaces from search term and item name - searchTerm = searchTerm.replace(/[^a-z0-9 ]/gi, "") - itemName = itemName.replace(/[^a-z0-9 ]/gi, "") + searchTerm = searchTerm.replace(/[^\p{L}\p{N}]/gu, "") + itemName = itemName.replace(/[^\p{L}\p{N}]/gu, "") if (itemName.includes(searchTerm) || artistName.includes(searchTerm) || albumName.includes(searchTerm)) { @@ -4021,4 +4021,4 @@ const app = new Vue({ }) -export { app } \ No newline at end of file +export { app }