HtmlUtils class
Utility class for HTML text processing.
Provides methods to unescape HTML entities and strip HTML tags from strings. Useful for sanitizing HTML content for display as plain text.
Example usage:
HtmlUtils.unescape('<Hello>'); // '<Hello>'
HtmlUtils.removeHtmlTags('<p>Hello <b>World</b></p>'); // 'Hello World'
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
removeHtmlTags(
String? htmlText) → String? - Removes all HTML tags from a string, leaving only the text content.
-
toPlainText(
String? htmlText) → String? - Strips HTML tags and unescapes HTML entities in one operation.
-
unescape(
String? htmlText) → String? - Converts HTML entities to their corresponding characters.