Preparar repositorio para despliegue: código fuente limpio

This commit is contained in:
jlimolina 2026-01-23 02:00:40 +01:00
parent 866f5c432d
commit 3eca832c1a
76 changed files with 5434 additions and 3496 deletions

View file

@ -13,8 +13,14 @@ def safe_html(texto: Optional[str]) -> str:
return ""
# Sanitize content to prevent layout breakage (e.g. unclosed divs)
allowed_tags = ['b', 'i', 'strong', 'em', 'p', 'br', 'span', 'a']
allowed_attrs = {'a': ['href', 'target', 'rel']}
allowed_tags = [
'b', 'i', 'strong', 'em', 'p', 'br', 'span', 'a', 'img',
'h1', 'h2', 'h3', 'h4', 'ul', 'ol', 'li', 'blockquote'
]
allowed_attrs = {
'a': ['href', 'target', 'rel', 'title'],
'img': ['src', 'alt', 'title', 'width', 'height', 'style']
}
cleaned = bleach.clean(texto, tags=allowed_tags, attributes=allowed_attrs, strip=True)
return Markup(cleaned)