processHtml static method
Helper function to process input html
Implementation
static String processHtml({
required String html,
bool processInputHtml = true,
bool processNewLineAsBr = false,
}) {
if (processInputHtml) {
html = kIsWeb
? html.replaceAll('\r', '').replaceAll('\r\n', '')
: html
.replaceAll("'", r"\'")
.replaceAll('"', r'\"')
.replaceAll('\r', '')
.replaceAll('\r\n', '');
}
if (processNewLineAsBr) {
html = html.replaceAll('\n', '<br/>').replaceAll('\n\n', '<br/>');
} else {
html = html.replaceAll('\n', '').replaceAll('\n\n', '');
}
return html;
}