fixup! Extract method to convert html content to text content
Move the method in utils
This commit is contained in:
@@ -867,25 +867,11 @@ class ComposerController extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
String convertHtmlContentToTextContent(String htmlContent) {
|
||||
String textContent = htmlContent.replaceAll(RegExp(r'<[^>]*>'), '');
|
||||
|
||||
textContent = textContent
|
||||
.replaceAll(' ', ' ')
|
||||
.replaceAll('&', '&')
|
||||
.replaceAll('<', '<')
|
||||
.replaceAll('>', '>')
|
||||
.replaceAll('"', '"')
|
||||
.replaceAll(''', "'");
|
||||
|
||||
return textContent.trim();
|
||||
}
|
||||
|
||||
Future<String> getTextOnlyContentInEditor() async {
|
||||
try {
|
||||
final htmlContent = await getContentInEditor();
|
||||
|
||||
String textContent = convertHtmlContentToTextContent(htmlContent);
|
||||
String textContent = StringConvert.convertHtmlContentToTextContent(htmlContent);
|
||||
|
||||
return textContent;
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user