Class StripHtmlFilter

java.lang.Object
org.shredzone.commons.text.filter.StripHtmlFilter
All Implemented Interfaces:
Function<CharSequence,​CharSequence>, TextFilter

public class StripHtmlFilter extends Object implements TextFilter
A filter that strips HTML markup from a text.

This filter distinguishes between block and inline tags. Block tags are replaced by a whitespace (unless there already was a whitespace before the tag), while inline tags are just removed.

Rationale: "foo<br>bar" is converted to "foo bar", while "foo<i>bar</i>" is converted to "foobar", similar to the way it is displayed in a web browser.

Author:
Richard "Shred" Körber