2013/8/6 <
doa...@googlemail.com>:
> private static final Pattern ANYTHING = Pattern.compile(".*");
This probably needs Pattern.DOT_ALL, or you could use
Predicates.<String>alwaysTrue()
> .allowAttributes("colspan", "rowspan").matching(NUMBER)
> .onElements("iframe")
This is saying "allow attributes colspan and rowspan that match the
pattern number on elements iframe".
> .allowAttributes("src").matching(YOUTUBE)
> .onElements("iframe")
This is allowing src on iframe which is working for you.
> .allowAttributes("height" , "width").matching(NUMBER_OR_PERCENT)
> .onElements("td", "th")
And this is allowing height and width on elements td and th which is
duplicative of an earlier allow.
You can solve this by putting calls to allowAttributes first, and
follow them with onElements thus:
.allowAttributes("src").matching(YOUTUBE).onElements("iframe")
.allowAttributes("height", "width")
.matching(NUMBER_OR_PERCENT).onElements("iframe")
.allowAttributes("allowfullscreen")
.matching(Pattern.compile("allowfullscreen")).onElements("iframe")
.allowAttributes("frameborder").matching(NUMBER).onElements("iframe")