From 2f0b7be41515ee64ed0b1e485c7ba40292b72fca Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Aug 30 2024 07:46:51 +0000 Subject: Do not use '+' with frozenset and list Fix exception: TypeError: unsupported operand type(s) for +: 'frozenset' and 'list' --- diff --git a/fedocal/__init__.py b/fedocal/__init__.py index 630c03d..6a7fe8a 100644 --- a/fedocal/__init__.py +++ b/fedocal/__init__.py @@ -195,10 +195,10 @@ def sanitize(text): """ Sanitize a given text from any not-allowed html using bleach. """ return bleach.clean( text, - tags=bleach.ALLOWED_TAGS + [ + tags=bleach.ALLOWED_TAGS.union([ 'p', 'br', 'div', 'h1', 'h2', 'h3', 'table', 'td', 'tr', 'th', 'col', 'tbody', 'pre', 'img', - ], + ]), attributes=bleach.ALLOWED_ATTRIBUTES )