fixup! Extract method to convert html content to text content
Move the method in utils
This commit is contained in:
@@ -196,4 +196,18 @@ class StringConvert {
|
||||
.map((e) => NamedAddress(name: '', address: e))
|
||||
.toList();
|
||||
}
|
||||
|
||||
static String convertHtmlContentToTextContent(String htmlContent) {
|
||||
String textContent = htmlContent.replaceAll(RegExp(r'<[^>]*>'), '');
|
||||
|
||||
textContent = textContent
|
||||
.replaceAll(' ', ' ')
|
||||
.replaceAll('&', '&')
|
||||
.replaceAll('<', '<')
|
||||
.replaceAll('>', '>')
|
||||
.replaceAll('"', '"')
|
||||
.replaceAll(''', "'");
|
||||
|
||||
return textContent.trim();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user