-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TF-1912 Sanitize html for email content when type is text/plain
- Loading branch information
Showing
2 changed files
with
25 additions
and
2 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
core/lib/presentation/utils/html_transformer/text/sanitize_html_transformers.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters