From c5e3c76cc1a91b0e8f946c59ff4c76f784ec5447 Mon Sep 17 00:00:00 2001 From: Martin Berka Date: Tue, 4 Jul 2023 10:24:43 +0200 Subject: [PATCH] =?UTF-8?q?Podpora=20ned=C4=9Bliteln=C3=BDch=20mezer=20u?= =?UTF-8?q?=20n=C3=A1zv=C5=AF=20v=20TechTower?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/App.tsx | 1 + server/src/restaurants.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/client/src/App.tsx b/client/src/App.tsx index 515718c..776dfe3 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -207,6 +207,7 @@ function App() {
  • Zavedení JWT, přesun autentizace na server
  • Oprava pádu v případě, že ve Sladovnické daný den nic není
  • Podpora situace, kdy ve Sladovnické je méně než 3 hlavní jídla
  • +
  • Oprava parsování cen z TechTower v případě použití nedělitelných mezer
  • Dnes je {data.date}

    diff --git a/server/src/restaurants.ts b/server/src/restaurants.ts index cd68f14..5b82d33 100644 --- a/server/src/restaurants.ts +++ b/server/src/restaurants.ts @@ -348,7 +348,7 @@ export const getMenuTechTower = async (date: Date = new Date(), mock: boolean = let price = '? Kč'; let name = text; if (text.endsWith('Kč')) { - const tmp = text.split(' '); + const tmp = text.replace('\xA0', ' ').split(' '); const split = [tmp.slice(0, -2).join(' ')].concat(tmp.slice(-2)); price = split.slice(1).join(" ") name = split[0]