marksweb / django-bleach

Bleach is a Python module that takes any HTML input, and returns valid, sanitised HTML that contains only an allowed subset of HTML tags, attributes and styles. django-bleach is a Django app that makes using bleach extremely easy.
MIT License
148 stars 23 forks source link

Allow tag filtering #69

Closed DatDerpyDude81 closed 2 years ago

DatDerpyDude81 commented 2 years ago

Please add a way to filter only a select few HTML tags. I want to use this to filter out only script tags and I end up having to list out every HTML tag except the script tag.

marksweb commented 2 years ago

I'm afraid that's not how bleach works.

They do "allowed" rather than "not allowed"

https://bleach.readthedocs.io/en/latest/clean.html

You'd need to raise a feature request with bleach for this.