From 672cdcf9f454cf2ebdaa4276486dde6db12ff245 Mon Sep 17 00:00:00 2001 From: alexey-zakharenkov <35913079+alexey-zakharenkov@users.noreply.github.com> Date: Thu, 21 Nov 2019 16:21:51 +0300 Subject: [PATCH] Fix ', ' splitting (#84) --- render/js/metro.js | 4 +++- v2h_templates.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/render/js/metro.js b/render/js/metro.js index b640734..c2d79b3 100644 --- a/render/js/metro.js +++ b/render/js/metro.js @@ -66,7 +66,9 @@ L.CitySelect = L.Control.extend({ } for (var i = 0; i < cities.length; i++) { - city_name = cities[i].split(',')[0]; + // Remove country name which follows last comma and doesn't contain commas itself + var last_comma_index = cities[i].lastIndexOf(','); + var city_name = cities[i].substring(0, last_comma_index); content += ''; } diff --git a/v2h_templates.py b/v2h_templates.py index b529bd2..0014ba5 100644 --- a/v2h_templates.py +++ b/v2h_templates.py @@ -158,7 +158,7 @@ COUNTRY_CITY = '''
{warnings}
- + ''' COUNTRY_FOOTER = '''