TF-4223 Fix welcome email is not well displayed

This commit is contained in:
dab246
2026-01-09 20:23:28 +07:00
committed by Dat H. Pham
parent 6f455cc728
commit ad768f1552
7 changed files with 33 additions and 18 deletions
+2 -2
View File
@@ -1020,10 +1020,10 @@ packages:
description: description:
path: sanitize_html path: sanitize_html
ref: support_mail ref: support_mail
resolved-ref: "6627e13f2236bdea5d25f648e6d55b214a4569df" resolved-ref: "21f9da9bc177f5f29bc871d70f0b5f5fa2085d89"
url: "https://github.com/linagora/dart-neats.git" url: "https://github.com/linagora/dart-neats.git"
source: git source: git
version: "3.0.0" version: "3.0.1"
shelf: shelf:
dependency: transitive dependency: transitive
description: description:
+2 -2
View File
@@ -973,10 +973,10 @@ packages:
description: description:
path: sanitize_html path: sanitize_html
ref: support_mail ref: support_mail
resolved-ref: "6627e13f2236bdea5d25f648e6d55b214a4569df" resolved-ref: "21f9da9bc177f5f29bc871d70f0b5f5fa2085d89"
url: "https://github.com/linagora/dart-neats.git" url: "https://github.com/linagora/dart-neats.git"
source: git source: git
version: "3.0.0" version: "3.0.1"
shelf: shelf:
dependency: transitive dependency: transitive
description: description:
@@ -77,6 +77,22 @@ void main() {
'touchmove', 'touchmove',
'touchend', 'touchend',
'touchcancel', 'touchcancel',
'wheel',
'animationstart',
'animationend',
'animationiteration',
'transitionstart',
'transitionend',
'transitionrun',
'transitioncancel',
'pointerdown',
'pointerup',
'pointermove',
'pointerenter',
'pointerleave',
'pointerover',
'pointerout',
'pointercancel',
]; ];
String sanitize(String input) => String sanitize(String input) =>
@@ -161,9 +177,9 @@ void main() {
expect(sanitize('<footer href="javascript:1"></footer>'), equals('<footer></footer>')); expect(sanitize('<footer href="javascript:1"></footer>'), equals('<footer></footer>'));
}); });
test('SHOULD unwrap <supress_time_adjustment> AND keep children', () { test('SHOULD unwrap <suppress_time_adjustment> AND keep children', () {
const html = const html =
'<supress_time_adjustment href="javascript:1"><div><p>Hello</p></div></supress_time_adjustment>'; '<suppress_time_adjustment href="javascript:1"><div><p>Hello</p></div></suppress_time_adjustment>';
expect(sanitize(html), equals('<div><p>Hello</p></div>')); expect(sanitize(html), equals('<div><p>Hello</p></div>'));
}); });
@@ -334,19 +350,19 @@ void main() {
group('FORM safe attributes safely unwrapped', () { group('FORM safe attributes safely unwrapped', () {
test('SHOULD unwrap FORM with safe style', () { test('SHOULD unwrap FORM with safe style', () {
expect(sanitize('<form style="color: red;"></form>'), contains('')); expect(sanitize('<form style="color: red;"></form>'), equals(''));
}); });
test('SHOULD unwrap FORM with safe class', () { test('SHOULD unwrap FORM with safe class', () {
expect(sanitize('<form class="email-form"></form>'), contains('')); expect(sanitize('<form class="email-form"></form>'), equals(''));
}); });
test('SHOULD unwrap FORM with safe id', () { test('SHOULD unwrap FORM with safe id', () {
expect(sanitize('<form id="my-form"></form>'), contains('')); expect(sanitize('<form id="my-form"></form>'), equals(''));
}); });
test('SHOULD unwrap FORM with safe bgcolor', () { test('SHOULD unwrap FORM with safe bgcolor', () {
expect(sanitize('<form bgcolor="#fff"></form>'), contains('')); expect(sanitize('<form bgcolor="#fff"></form>'), equals(''));
}); });
test('SHOULD remove dangerous attributes even when safe attributes exist', () { test('SHOULD remove dangerous attributes even when safe attributes exist', () {
+1 -2
View File
@@ -1,4 +1,3 @@
import 'package:core/utils/string_convert.dart';
import 'package:equatable/equatable.dart'; import 'package:equatable/equatable.dart';
import 'package:model/email/email_content_type.dart'; import 'package:model/email/email_content_type.dart';
@@ -21,6 +20,6 @@ extension EmailContentExtension on EmailContent {
.replaceAll('\n', '<br/>') .replaceAll('\n', '<br/>')
.replaceAll('\n\n', '<br/>'); .replaceAll('\n\n', '<br/>');
} }
return StringConvert.getContentOriginal(content); return content;
} }
} }
+2 -2
View File
@@ -997,10 +997,10 @@ packages:
description: description:
path: sanitize_html path: sanitize_html
ref: support_mail ref: support_mail
resolved-ref: "6627e13f2236bdea5d25f648e6d55b214a4569df" resolved-ref: "21f9da9bc177f5f29bc871d70f0b5f5fa2085d89"
url: "https://github.com/linagora/dart-neats.git" url: "https://github.com/linagora/dart-neats.git"
source: git source: git
version: "3.0.0" version: "3.0.1"
shelf: shelf:
dependency: transitive dependency: transitive
description: description:
+2 -2
View File
@@ -1997,10 +1997,10 @@ packages:
description: description:
path: sanitize_html path: sanitize_html
ref: support_mail ref: support_mail
resolved-ref: "6627e13f2236bdea5d25f648e6d55b214a4569df" resolved-ref: "21f9da9bc177f5f29bc871d70f0b5f5fa2085d89"
url: "https://github.com/linagora/dart-neats.git" url: "https://github.com/linagora/dart-neats.git"
source: git source: git
version: "3.0.0" version: "3.0.1"
scribe: scribe:
dependency: "direct main" dependency: "direct main"
description: description:
+2 -2
View File
@@ -1003,10 +1003,10 @@ packages:
description: description:
path: sanitize_html path: sanitize_html
ref: support_mail ref: support_mail
resolved-ref: fda32cde4d4baadaa988477f498ab6622ee79987 resolved-ref: "21f9da9bc177f5f29bc871d70f0b5f5fa2085d89"
url: "https://github.com/linagora/dart-neats.git" url: "https://github.com/linagora/dart-neats.git"
source: git source: git
version: "2.1.0" version: "3.0.1"
shelf: shelf:
dependency: transitive dependency: transitive
description: description: