Rethink Validator SafeHtml design to support custom "WhiteListType"

Description

The underlying JSoup html validation framework is much more powerful than the current implementation of the SafeHtml Validator allows. Instead of using a fixed enumeration the Whitelist class itself should be provided as an attribute to the validator. Use case:

Providing rich-html content where it is sometimes necessary to float some components/images on the right side next to the text I tried to allow the tag "div" and used the straightforward "additionalTags" attribute just to realize in the next step there is no way I can add the attributes "class" or "style" to it (in general or restricted to "div").

Without those attributes my "div" is useless.

Environment

None

relates to

Activity

Show:

Marco JancJanuary 21, 2014 at 12:23 AM

Sorry I recently am very busy and had no time for a test-case. I will post as soon i have time for it.

Hardy FerentschikJanuary 12, 2014 at 7:33 PM

An upgrade of JSoup at the same time is still not possible - see and https://github.com/jhy/jsoup/issues/299

Hardy FerentschikSeptember 10, 2013 at 11:38 AM

So far I think the best approach is:

Hardy FerentschikSeptember 10, 2013 at 10:41 AM

Hardy FerentschikSeptember 10, 2013 at 10:31 AM

, any chance you could provide a test case as well? Maybe just an addition to SafeHtmlValidatorTest

Fixed

Details

Assignee

Reporter

Labels

Participants

Gunnar Morling
Hardy Ferentschik
Marco Janc

Components

Fix versions

Affects versions

Priority

Created August 23, 2013 at 10:13 PM
Updated January 28, 2014 at 9:51 AM
Resolved January 13, 2014 at 10:54 AM