Remove any html from buy links

main
Bob Mottram 2023-07-12 09:53:32 +01:00
parent 3d44013f92
commit 8f1c8ad742
1 changed files with 3 additions and 3 deletions

View File

@ -2393,19 +2393,19 @@ def get_buy_links(post_json_object: str, translate: {}, buy_sites: {}) -> {}:
if isinstance(item['rel'], str): if isinstance(item['rel'], str):
if item['rel'] in ('payment', 'pay', 'donate', 'donation', if item['rel'] in ('payment', 'pay', 'donate', 'donation',
'buy', 'purchase'): 'buy', 'purchase'):
links[item_name] = item['href'] links[item_name] = remove_html(item['href'])
continue continue
if buy_sites: if buy_sites:
# limited to an allowlist of buying sites # limited to an allowlist of buying sites
for site, buy_domain in buy_sites.items(): for site, buy_domain in buy_sites.items():
if buy_domain in item['href']: if buy_domain in item['href']:
links[site.title()] = item['href'] links[site.title()] = remove_html(item['href'])
continue continue
else: else:
# The name only needs to indicate that this is a buy link # The name only needs to indicate that this is a buy link
for buy_str in buy_strings: for buy_str in buy_strings:
if buy_str in item_name.lower(): if buy_str in item_name.lower():
links[item_name] = item['href'] links[item_name] = remove_html(item['href'])
continue continue
return links return links