mirror of
https://github.com/jointakahe/takahe.git
synced 2024-11-22 15:21:01 +00:00
cfe18932b8
Creates filter for REWRITTEN_TAGS that converts them to `p` rather than ripping them out entirely, and formats `ul` as break-separated list Both changes align sanitization to Mastodon's "strict" sanitizer at https://github.com/mastodon/mastodon/blob/main/lib/sanitize_ext/sanitize_config.rb#L73 I don't love the complexity of the Filter, but Bleach doesn't give us great options to work with. The code operates within an iterator without the useful "sibling" methods that Ruby's equivalent has. Also, Bleach runs filters _after_ sanitizing (unlike Ruby's which runs before) so we have to pass all the elements through the sanitizer, then rewrite them after the fact. |
||
---|---|---|
.. | ||
migrations | ||
models | ||
templatetags | ||
__init__.py | ||
admin.py | ||
apps.py | ||
context.py | ||
decorators.py | ||
exceptions.py | ||
files.py | ||
html.py | ||
htmx.py | ||
ld.py | ||
middleware.py | ||
sentry.py | ||
signatures.py | ||
snowflake.py | ||
uploads.py | ||
uris.py | ||
views.py |