HtmlCharacterEntities class
A utility class containing a map, characters, of key/value pairs for
every HTML 4.01 character entity, including ASCII codes, and a method,
parse
, to parse strings for those character entities.
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
-
decode(
String string) → String -
Parses a
string
and replaces all valid HTML character entities with their respective characters. -
encode(
String string, {String? characters = '&<>"\'', bool defaultToAsciiCode = false, bool defaultToHexCode = false, bool checkAmpsForEntities = true}) → String -
Parses a
string
and replaces every character included in thecharacters
string with their corresponding character entity.
Constants
-
asciiCodes
→ const Map<
String, String> - A map of all symbols with an ASCII code character entity.
-
characters
→ const Map<
String, String> - A map of all HTML 4.01 character entities and their corresponding characters.
-
entities
→ const Map<
String, String> - A map of all symbols with their corresponding non-ASCII code charcter entities.
-
hexCodes
→ const Map<
String, String> - A map of all symbols with a hex code character entities.