Sanitize Html message content

This commit is contained in:
dab246
2021-08-24 13:41:21 +07:00
committed by Dat H. Pham
parent 842072e0d6
commit 4afb309ad4
10 changed files with 431 additions and 53 deletions
@@ -0,0 +1,15 @@
extension HtmlExtension on String {
String removeFontSizeZeroPixel() => replaceAll(RegExp('font-size:0px;'), '');
String removeHeightZeroPixel() => replaceAll(RegExp('height:0px;'), '');
String removeWidthZeroPixel() => replaceAll(RegExp('width:0px;'), '');
String removeMaxWidthZeroPixel() => replaceAll(RegExp('max-width:0px;'), '');
String removeMaxHeightZeroPixel() => replaceAll(RegExp('max-height:0px;'), '');
String changeStyleBackground() => replaceAll(RegExp('background:'), 'background-color:');
}