It's actually as easy as:
DivElement elt = Document.get().createDivElement();
elt.setInnerHTML( SimpleHtmlSanitizer.sanitizeHtml(myHtmlString) );
String plainTextString = elt.getInnerText();
Or you could of course use code similar to the SimpleHtmlSanitizer that
strings *all* the HTML tags, instead of just the non-white-listed ones;
that would save you from the setInnerHTML/getInnerText dance so could
possibly perform better (and the "sanitizer" code would probably be simpler
as well)
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-web-toolkit/-/DCoGQH1FSc8J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.