Skip to content

Clean html improvements#397

Open
deseven wants to merge 2 commits intoredimp:mainfrom
deseven:clean_html_improvements
Open

Clean html improvements#397
deseven wants to merge 2 commits intoredimp:mainfrom
deseven:clean_html_improvements

Conversation

@deseven
Copy link
Contributor

@deseven deseven commented Feb 24, 2026

This changes the logic of clean_html() from being a blacklist to being a whitelist instead, since I found multiple ways to do harmful stuff otherwise.

Also, the user is now allowed to explicitly allow anything using the new config parameter RENDERER_HTML_WHITELIST, which follows a (hopefully) simple format of tag1[attr1 attr2],tag2,tag3[attr3], for example:

RENDERER_HTML_WHITELIST=iframe[src width height],svg,button

Please check out the list of default allowed tags and attributes, see if something needs to be added or removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant