revert html util change. (#309)

This commit is contained in:
Jojo Feng
2023-11-06 21:40:53 -06:00
committed by GitHub
parent 58c646e232
commit 0310507c96

View File

@ -34,6 +34,7 @@ abstract class HtmlUtil {
static String parseHtml(String text) {
return HtmlUnescape()
.convert(text)
.replaceAll('<p>', '\n')
.replaceAllMapped(
RegExp(r'\<i\>(.*?)\<\/i\>'),
(Match match) => '*${match[1]}*',
@ -42,7 +43,6 @@ abstract class HtmlUtil {
RegExp(r'\<a href=\"(.*?)\".*?\>.*?\<\/a\>'),
(Match match) => match[1] ?? '',
)
.replaceAll('\n', '\n\n')
.replaceAll('<p>\n\n', '');
.replaceAll('\n', '\n\n');
}
}