snimavat / html-cleaner

Html cleaner - Whitelist based html sanitizer grails plugin
3 stars 2 forks source link

Add support for addProtocols method in Config #5

Closed ishults closed 10 years ago

ishults commented 10 years ago

Currently there is no way to add protocols to whitelists as allowed in JSoup here: http://jsoup.org/apidocs/org/jsoup/safety/Whitelist.html#addProtocols%28java.lang.String,%20java.lang.String,%20java.lang.String...%29

It would be help if we could add protocols via something like:

allow('a') {
    protocols attribute: 'href', value: 'http'
    protocols attribute: 'href', value: 'https'
}

or

allow('a') {
    protocols attribute: 'href', value: ['http', 'https']
}