TF-1912 Sanitize html for email content when type is text/plain

(cherry picked from commit 169ede2f8b59cdf0362ad449d1182597cd4e5dee)
This commit is contained in:
dab246
2023-07-17 19:05:40 +07:00
committed by Dat Vu
parent cd9c51ff0d
commit 21621c0705
2 changed files with 25 additions and 2 deletions
@@ -0,0 +1,17 @@
import 'dart:convert';
import 'package:core/presentation/utils/html_transformer/base/text_transformer.dart';
import 'package:core/utils/app_logger.dart';
class SanitizeHtmlTransformers extends TextTransformer {
const SanitizeHtmlTransformers();
@override
String process(String text) {
final htmlEncoded = const HtmlEscape().convert(text);
log('HtmlSanitizerTransformers::process:htmlEncoded: $htmlEncoded');
return htmlEncoded;
}
}