toHtmlText method
Convert to HTML Text.
Implementation
String toHtmlText() {
if (this == null) {
throw ArgumentError('string: $this');
}
return this!.replaceAllMapped(RegExp(r'([<>&])'), (match) {
final char = match.group(1)!;
if (char == '<') {
return '<';
} else if (char == '>') {
return '>';
} else if (char == '&') {
return '&';
} else {
return char;
}
});
}