TF-194 Fix style the block quote tag
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
|
||||
import 'package:html/dom.dart';
|
||||
import 'package:core/presentation/utils/html_transformer/base/dom_transformer.dart';
|
||||
import 'package:core/presentation/utils/html_transformer/transform_configuration.dart';
|
||||
|
||||
class BlockQuotedTransformer extends DomTransformer {
|
||||
|
||||
const BlockQuotedTransformer();
|
||||
|
||||
@override
|
||||
void process(Document document, String message, TransformConfiguration configuration) {
|
||||
final quotedElements = document.getElementsByTagName('blockquote');
|
||||
for (final quotedElement in quotedElements) {
|
||||
quotedElement.attributes['style'] = '''
|
||||
margin-left: 4px;
|
||||
margin-right: 4px;
|
||||
padding-left: 8px;
|
||||
padding-right: 8px;
|
||||
border-left: 2px solid #eee;
|
||||
''';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
|
||||
import 'package:core/presentation/utils/html_transformer/dom/blockquoted_transformers.dart';
|
||||
import 'package:core/presentation/utils/html_transformer/dom/image_transformers.dart';
|
||||
import 'package:core/presentation/utils/html_transformer/dom/link_transformers.dart';
|
||||
import 'package:core/presentation/utils/html_transformer/dom/meta_transformers.dart';
|
||||
@@ -61,6 +62,7 @@ class TransformConfiguration {
|
||||
RemoveScriptTransformer(),
|
||||
ImageTransformer(),
|
||||
EnsureRelationNoReferrerTransformer(),
|
||||
BlockQuotedTransformer(),
|
||||
];
|
||||
|
||||
static const List<TextTransformer> standardTextTransformers = [
|
||||
|
||||
@@ -67,14 +67,6 @@ class _HtmlContentViewState extends State<HtmlContentViewer> {
|
||||
color: #182952;
|
||||
font-family: verdana;
|
||||
}
|
||||
blockquote {
|
||||
font: normal helvetica, verdana;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
margin-left: 20px;
|
||||
padding-left: 15px;
|
||||
border-left: 5px solid #eee;
|
||||
}
|
||||
table {
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
|
||||
Reference in New Issue
Block a user