fix(mu): email content not displayed due to sanitize html
(cherry picked from commit 2f06e52d81864a62d6e588bb24a6845e20371bf4)
This commit is contained in:
+1
-1
@@ -16,7 +16,7 @@ class SanitizeHyperLinkTagInHtmlTransformer extends DomTransformer {
|
||||
Map<String, String>? mapUrlDownloadCID,
|
||||
}) async {
|
||||
try {
|
||||
final elements = document.querySelectorAll('a');
|
||||
final elements = document.querySelectorAll('a[href]');
|
||||
|
||||
if (elements.isEmpty) return;
|
||||
|
||||
|
||||
+5
-32
@@ -3,40 +3,13 @@ import 'package:core/presentation/utils/html_transformer/base/text_transformer.d
|
||||
import 'package:core/presentation/utils/html_transformer/sanitize_html.dart';
|
||||
|
||||
class StandardizeHtmlSanitizingTransformers extends TextTransformer {
|
||||
|
||||
static const List<String> mailAllowedHtmlAttributes = [
|
||||
'style',
|
||||
'public-asset-id',
|
||||
'data-filename',
|
||||
'bgcolor',
|
||||
'id',
|
||||
'class',
|
||||
'data-mimetype',
|
||||
];
|
||||
|
||||
static const List<String> mailAllowedHtmlTags = [
|
||||
'font',
|
||||
'u',
|
||||
'center',
|
||||
'style',
|
||||
'body',
|
||||
'section',
|
||||
'google-sheets-html-origin',
|
||||
'colgroup',
|
||||
'col',
|
||||
'nav',
|
||||
'main',
|
||||
'footer',
|
||||
'supress_time_adjustment',
|
||||
];
|
||||
static final SanitizeHtml _sanitizer = SanitizeHtml();
|
||||
|
||||
const StandardizeHtmlSanitizingTransformers();
|
||||
|
||||
@override
|
||||
String process(String text, HtmlEscape htmlEscape) =>
|
||||
SanitizeHtml().process(
|
||||
inputHtml: text,
|
||||
allowAttributes: mailAllowedHtmlAttributes,
|
||||
allowTags: mailAllowedHtmlTags,
|
||||
);
|
||||
String process(String text, HtmlEscape htmlEscape) {
|
||||
if (text.isEmpty) return '';
|
||||
return _sanitizer.process(inputHtml: text);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user