Remove any html from location string

main
Bob Mottram 2023-07-12 12:46:25 +01:00
parent eca0fa1736
commit b7f3afa014
3 changed files with 5 additions and 3 deletions

View File

@ -404,7 +404,7 @@ def _icalendar_day(base_dir: str, nickname: str, domain: str,
event_description = evnt['name'].strip()
elif evnt['type'] == 'Place':
if evnt.get('name'):
event_place = evnt['name']
event_place = remove_html(evnt['name'])
print('icalendar: ' + str(post_id) + ' ' +
str(event_start) + ' ' + str(event_description) + ' ' +

View File

@ -30,7 +30,8 @@ def get_location_from_tags(tags: []) -> str:
continue
if not isinstance(tag_item['name'], str):
continue
return tag_item['name'].replace('\n', ' ')
location_str = tag_item['name'].replace('\n', ' ')
return remove_html(location_str)
return None

View File

@ -10,6 +10,7 @@ __module_group__ = "Calendar"
import os
from datetime import datetime
from datetime import date
from utils import remove_html
from utils import get_display_name
from utils import get_config_param
from utils import get_nickname_from_actor
@ -224,7 +225,7 @@ def _html_calendar_day(person_cache: {}, translate: {},
event_description = evnt['name'].strip()
elif evnt['type'] == 'Place':
if evnt.get('name'):
event_place = evnt['name']
event_place = remove_html(evnt['name'])
if '://' in event_place:
bounding_box_degrees = 0.001
event_map = \