Skip to content

Commit 6df4cd6

Browse files
committed
fix(mu): email content not displayed due to sanitize html
1 parent b931312 commit 6df4cd6

File tree

10 files changed

+343
-131
lines changed

10 files changed

+343
-131
lines changed

contact/pubspec.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,8 +1019,8 @@ packages:
10191019
dependency: transitive
10201020
description:
10211021
path: sanitize_html
1022-
ref: support_mail
1023-
resolved-ref: fda32cde4d4baadaa988477f498ab6622ee79987
1022+
ref: "feat/new-sanitize-engine"
1023+
resolved-ref: "18b7ad5f4348d1c1416184de293e14f032da9022"
10241024
url: "https://github.com/linagora/dart-neats.git"
10251025
source: git
10261026
version: "2.1.0"

core/lib/presentation/utils/html_transformer/text/standardize_html_sanitizing_transformers.dart

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,13 @@ import 'package:core/presentation/utils/html_transformer/base/text_transformer.d
33
import 'package:core/presentation/utils/html_transformer/sanitize_html.dart';
44

55
class StandardizeHtmlSanitizingTransformers extends TextTransformer {
6-
7-
static const List<String> mailAllowedHtmlAttributes = [
8-
'style',
9-
'public-asset-id',
10-
'data-filename',
11-
'bgcolor',
12-
'id',
13-
'class',
14-
'data-mimetype',
15-
];
16-
17-
static const List<String> mailAllowedHtmlTags = [
18-
'font',
19-
'u',
20-
'center',
21-
'style',
22-
'body',
23-
'section',
24-
'google-sheets-html-origin',
25-
'colgroup',
26-
'col',
27-
'nav',
28-
'main',
29-
'footer',
30-
'supress_time_adjustment',
31-
];
6+
static final SanitizeHtml _sanitizer = SanitizeHtml();
327

338
const StandardizeHtmlSanitizingTransformers();
349

3510
@override
36-
String process(String text, HtmlEscape htmlEscape) =>
37-
SanitizeHtml().process(
38-
inputHtml: text,
39-
allowAttributes: mailAllowedHtmlAttributes,
40-
allowTags: mailAllowedHtmlTags,
41-
);
11+
String process(String text, HtmlEscape htmlEscape) {
12+
if (text.isEmpty) return '';
13+
return _sanitizer.process(inputHtml: text);
14+
}
4215
}

core/pubspec.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -972,8 +972,8 @@ packages:
972972
dependency: "direct main"
973973
description:
974974
path: sanitize_html
975-
ref: support_mail
976-
resolved-ref: fda32cde4d4baadaa988477f498ab6622ee79987
975+
ref: "feat/new-sanitize-engine"
976+
resolved-ref: "18b7ad5f4348d1c1416184de293e14f032da9022"
977977
url: "https://github.com/linagora/dart-neats.git"
978978
source: git
979979
version: "2.1.0"

core/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ dependencies:
3333
sanitize_html:
3434
git:
3535
url: https://github.com/linagora/dart-neats.git
36-
ref: support_mail
36+
ref: feat/new-sanitize-engine
3737
path: sanitize_html
3838

3939
### Dependencies from pub.dev ###

0 commit comments

Comments
 (0)