diff --git a/core/lib/presentation/utils/html_transformer/text/persist_preformatted_text_transformer.dart b/core/lib/presentation/utils/html_transformer/text/persist_preformatted_text_transformer.dart index a6b8d2cf1..29dfc9f00 100644 --- a/core/lib/presentation/utils/html_transformer/text/persist_preformatted_text_transformer.dart +++ b/core/lib/presentation/utils/html_transformer/text/persist_preformatted_text_transformer.dart @@ -1,12 +1,18 @@ import 'dart:convert'; import 'package:core/presentation/utils/html_transformer/base/text_transformer.dart'; +import 'package:core/utils/html/html_template.dart'; +import 'package:core/utils/string_convert.dart'; class PersistPreformattedTextTransformer extends TextTransformer { const PersistPreformattedTextTransformer(); @override String process(String text, HtmlEscape htmlEscape) { - return '
$text
'; + if (StringConvert.isTextTable(text)) { + return '
$text
'; + } else { + return text; + } } } \ No newline at end of file diff --git a/core/lib/utils/html/html_template.dart b/core/lib/utils/html/html_template.dart index 887924fe2..61a9e7437 100644 --- a/core/lib/utils/html/html_template.dart +++ b/core/lib/utils/html/html_template.dart @@ -216,4 +216,6 @@ class HtmlTemplate { } '''; + + static const String markDownAndASCIIArtStyleCSS = 'display: block; font-family: monospace; white-space: pre; margin: 1em 0px;'; } \ No newline at end of file