HtmlUtils class abstract final

Utility class for HTML text processing.

Provides single-pass decoding of HTML entities (278 named + all numeric) and tag stripping. Entity data sourced from the html_unescape package's basic set, plus commonly-used entities beyond Latin-1.

Example:

HtmlUtils.unescape('&lt;Hello&gt;'); // '<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.