add span to allowed tags #185

This commit is contained in:
rimu 2024-05-13 10:54:30 +12:00
parent ade07d2658
commit 6bdf13d300

View file

@ -180,7 +180,7 @@ def allowlist_html(html: str) -> str:
if html is None or html == '': if html is None or html == '':
return '' return ''
allowed_tags = ['p', 'strong', 'a', 'ul', 'ol', 'li', 'em', 'blockquote', 'cite', 'br', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'pre', allowed_tags = ['p', 'strong', 'a', 'ul', 'ol', 'li', 'em', 'blockquote', 'cite', 'br', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'pre',
'code', 'img', 'details', 'summary', 'table', 'tr', 'td', 'th', 'tbody', 'thead', 'hr'] 'code', 'img', 'details', 'summary', 'table', 'tr', 'td', 'th', 'tbody', 'thead', 'hr', 'span']
# Parse the HTML using BeautifulSoup # Parse the HTML using BeautifulSoup
soup = BeautifulSoup(html, 'html.parser') soup = BeautifulSoup(html, 'html.parser')