From 893ba53b79685baec613542ddc68c589e2126417 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 20 May 2024 14:05:30 +0100 Subject: [PATCH] Potentially could be more than two coordinates --- maps.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/maps.py b/maps.py index 038d40341..0e1a9fb77 100644 --- a/maps.py +++ b/maps.py @@ -205,7 +205,7 @@ def _geocoords_from_geo_link(url: str) -> (int, float, float): coords_str = url.split('geo:')[1] if ',' in coords_str: coords_sections = coords_str.split(',') - if len(coords_sections) == 2: + if len(coords_sections) >= 2: latitude_str = coords_sections[0] longitude_str = coords_sections[1] if ';' in longitude_str: @@ -552,7 +552,7 @@ def get_map_links_from_post_content(content: str) -> []: if ',' not in coords_str: continue coord_sections = coords_str.split(',') - if len(coord_sections) != 2: + if len(coord_sections) < 2: continue if not is_float(coord_sections[0]) or \ not is_float(coord_sections[1]):