tgalopin / html-sanitizer-bundle

Sanitize untrustworthy HTML user input (Symfony integration for https://github.com/tgalopin/html-sanitizer)
MIT License
85 stars 11 forks source link

Allow attributes (class, style, etc) for all tags in one time #25

Open bastien70 opened 2 years ago

bastien70 commented 2 years ago

Hello, is it possible to allow the tags attributes (like class, style, etc) for specifics (or all ) tags in one time in yaml ?

Currently, I've to do this in my config file :

html_sanitizer:
    default_sanitizer: 'default'
    sanitizers:
        default:
            extensions:
                - 'basic'
                - 'list'
                - 'table'
                - 'image'
                - 'code'

            tags:
                span:
                    allowed_attributes:
                        - style
                        - class

                table:
                    allowed_attributes:
                        - style
                        - class

                thead:
                    allowed_attributes:
                        - style
                        - class
lukepass commented 2 years ago

Yes, please!