Skip to content

allow sanitization of attributes based on attribute value #348

@inducer

Description

@inducer

I'm following up from #346 (closed), which covered my need of letting some (but not all) data: URLs in src attributes pass the sanitizer. What that PR did was piggyback on attribute filters to determine when a value should be allowed to bypass this logc that is otherwise unconditionally applied.

In that PR, @willkg said:

I suspect you can achieve what you're trying to achieve without making a substantial behavior change to Bleach.

Unless data: is added to the allowed_protocols (which seems risky), I don't see how this could be accomplished, but I would be happy to be educated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions