From 1fb1153f1379bd91a0ada4a0b0d83980ee725cb6 Mon Sep 17 00:00:00 2001 From: Dan Cojocaru Date: Tue, 15 Nov 2022 21:18:52 +0100 Subject: [PATCH] Fix station search bug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When writing "cala" in order to search for "Călărași", it wouldn't work because only the first ă was replaced with a. --- station.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/station.js b/station.js index 9ae78f2..7d65211 100755 --- a/station.js +++ b/station.js @@ -11,11 +11,11 @@ function goToStation(station) { function searchNormalize(str) { return str .toLowerCase() - .replace('ă', 'a') - .replace('â', 'a') - .replace('î', 'i') - .replace('ș', 's') - .replace('ț', 't') + .replaceAll('ă', 'a') + .replaceAll('â', 'a') + .replaceAll('î', 'i') + .replaceAll('ș', 's') + .replaceAll('ț', 't') } var focusedElement = null