diff --git a/src/AppBundle/Service/CardsData.php b/src/AppBundle/Service/CardsData.php index 9b952db6..b9f2c098 100755 --- a/src/AppBundle/Service/CardsData.php +++ b/src/AppBundle/Service/CardsData.php @@ -267,7 +267,7 @@ public function get_search_rows(array $conditions, string $sortorder, string $lo $parameters[$i++] = $arg; } elseif ($acronym) { $cond = []; - $cond[] = "(BINARY(c.title) like ?$i)"; + $cond[] = "(c.strippedTitle like ?$i)"; $parameters[$i++] = "%$arg%"; $like = implode('% ', str_split($arg)); $cond[] = "(REPLACE(c.title, '-', ' ') like ?$i)"; @@ -280,7 +280,7 @@ public function get_search_rows(array $conditions, string $sortorder, string $lo $or[] = "not (" . implode ("or", $cond) . ")"; } } else { - $or[] = "(c.title " . ($operator == ":" ? "like" : "not like") . " ?$i)"; + $or[] = "(c.strippedTitle " . ($operator == ":" ? "like" : "not like") . " ?$i)"; $parameters[$i++] = "%$arg%"; } } diff --git a/web/js/deck.v2.js b/web/js/deck.v2.js index f12a39c0..afe429e9 100755 --- a/web/js/deck.v2.js +++ b/web/js/deck.v2.js @@ -105,11 +105,11 @@ Promise.all([NRDB.data.promise, NRDB.settings.promise]).then(function() { return _.deburr(cardTitle).toLowerCase().trim(); } var matchingCards = _.filter(latestCards, function (card) { - return regexp.test(normalizeTitle(card.title)); + return regexp.test(normalizeTitle(card.stripped_title)); }); matchingCards.sort((card1, card2) => { - var card1title = normalizeTitle(card1.title); - var card2title = normalizeTitle(card2.title); + var card1title = normalizeTitle(card1.stripped_title); + var card2title = normalizeTitle(card2.stripped_title); var normalizedQuery = normalizeTitle(q); if(card1title.startsWith(normalizedQuery) && !card2title.startsWith(normalizedQuery)) { return -1; diff --git a/web/js/nrdb.js b/web/js/nrdb.js index e6509d74..e5eed10d 100755 --- a/web/js/nrdb.js +++ b/web/js/nrdb.js @@ -536,7 +536,7 @@ function check_ampere_agenda_limits() { for (faction in agendasByFaction) { if (agendasByFaction[faction] > 2) { nb_violations++; - } + } } }); if(nb_violations > 0) { @@ -1119,7 +1119,7 @@ function build_jintekinet(deck) { return this.nodeType == 3; })[0].nodeValue[0]; var name = $(line).children('a').eq(0).text(); - lines.push(num + " " + name); + lines.push(num + " " + name.replaceAll(/ʼ/g, `'`).replaceAll(/[“”]/g, `"`)); }); return lines; } diff --git a/web/js/nrdb.smart_filter.js b/web/js/nrdb.smart_filter.js index d2fe2269..c2bb2897 100755 --- a/web/js/nrdb.smart_filter.js +++ b/web/js/nrdb.smart_filter.js @@ -26,7 +26,7 @@ switch (type) { case "": case "_": - add_string_sf('title', operator, values); + add_string_sf('stripped_title', operator, values); break; case "x": add_string_sf('text', operator, values); diff --git a/web/js/search.js b/web/js/search.js index 2338f9a6..4dff146c 100755 --- a/web/js/search.js +++ b/web/js/search.js @@ -9,7 +9,7 @@ $(document).on('data.app', function() { return _.deburr(cardTitle).toLowerCase().trim(); } var matchingCards = _.filter(latestCards, function (card) { - return regexp.test(normalizeTitle(card.title)); + return regexp.test(normalizeTitle(card.stripped_title)); }); matchingCards.sort((card1, card2) => { var card1title = normalizeTitle(card1.title); diff --git a/web/js/topnav.js b/web/js/topnav.js index 3d30faba..e287b762 100644 --- a/web/js/topnav.js +++ b/web/js/topnav.js @@ -27,11 +27,11 @@ Promise.all([NRDB.data.promise, NRDB.ui.promise]).then(function() { return _.deburr(cardTitle).toLowerCase().trim(); } var matchingCards = _.filter(latest_cards, function (card) { - return regexp.test(normalizeTitle(card.title)); + return regexp.test(normalizeTitle(card.stripped_title)); }); matchingCards.sort((card1, card2) => { - var card1title = normalizeTitle(card1.title); - var card2title = normalizeTitle(card2.title); + var card1title = normalizeTitle(card1.stripped_title); + var card2title = normalizeTitle(card2.stripped_title); var normalizedQuery = normalizeTitle(q); if(card1title.startsWith(normalizedQuery) && !card2title.startsWith(normalizedQuery)) { return -1;