@@ -13,12 +13,12 @@ import 'package:flutter_html/src/anchor.dart';
1313import 'package:flutter_html/src/css_parser.dart' ;
1414import 'package:flutter_html/src/html_elements.dart' ;
1515import 'package:flutter_html/src/layout_element.dart' ;
16+ import 'package:flutter_html/src/navigation_delegate.dart' ;
1617import 'package:flutter_html/src/utils.dart' ;
1718import 'package:flutter_html/style.dart' ;
1819import 'package:html/dom.dart' as dom;
1920import 'package:html/parser.dart' as htmlparser;
2021import 'package:numerus/numerus.dart' ;
21- import 'package:webview_flutter/webview_flutter.dart' ;
2222
2323typedef OnTap = void Function (
2424 String ? url,
@@ -61,6 +61,8 @@ class HtmlParser extends StatelessWidget {
6161 final TextSelectionControls ? selectionControls;
6262 final ScrollPhysics ? scrollPhysics;
6363
64+ final Map <String , Size > cachedImageSizes = {};
65+
6466 HtmlParser ({
6567 required this .key,
6668 required this .htmlData,
@@ -401,9 +403,11 @@ class HtmlParser extends StatelessWidget {
401403 );
402404 } else if (tree.style.display == Display .LIST_ITEM ) {
403405 List <InlineSpan > getChildren (StyledElement tree) {
404- InlineSpan tabSpan = WidgetSpan (child: Text ("\t " , textAlign: TextAlign .right));
405406 List <InlineSpan > children = tree.children.map ((tree) => parseTree (newContext, tree)).toList ();
406407 if (tree.style.listStylePosition == ListStylePosition .INSIDE ) {
408+ final tabSpan = WidgetSpan (
409+ child: Text ("\t " , textAlign: TextAlign .right, style: TextStyle (fontWeight: FontWeight .w400)),
410+ );
407411 children.insert (0 , tabSpan);
408412 }
409413 return children;
@@ -425,7 +429,7 @@ class HtmlParser extends StatelessWidget {
425429 padding: tree.style.padding ?? EdgeInsets .only (left: tree.style.direction != TextDirection .rtl ? 10.0 : 0.0 , right: tree.style.direction == TextDirection .rtl ? 10.0 : 0.0 ),
426430 child: newContext.style.markerContent
427431 ) : Container (height: 0 , width: 0 ),
428- Text ("\t " , textAlign: TextAlign .right),
432+ Text ("\t " , textAlign: TextAlign .right, style : TextStyle (fontWeight : FontWeight .w400) ),
429433 Expanded (
430434 child: Padding (
431435 padding: tree.style.listStylePosition == ListStylePosition .INSIDE ?
@@ -737,7 +741,6 @@ class HtmlParser extends StatelessWidget {
737741 String marker = "" ;
738742 switch (tree.style.listStyleType! ) {
739743 case ListStyleType .NONE :
740- tree.style.markerContent = '' ;
741744 break ;
742745 case ListStyleType .CIRCLE :
743746 marker = '○' ;
@@ -959,7 +962,7 @@ class HtmlParser extends StatelessWidget {
959962 if (child is EmptyContentElement || child is EmptyLayoutElement ) {
960963 toRemove.add (child);
961964 } else if (child is TextContentElement
962- && tree.name == "body"
965+ && ( tree.name == "body" || tree.name == "ul" )
963966 && child.text! .replaceAll (' ' , '' ).isEmpty) {
964967 toRemove.add (child);
965968 } else if (child is TextContentElement
@@ -1054,7 +1057,7 @@ class ContainerSpan extends StatelessWidget {
10541057 height: style.height,
10551058 width: style.width,
10561059 padding: style.padding,
1057- margin: style.margin,
1060+ margin: style.margin? . clamp ( EdgeInsets .zero, const EdgeInsets . all ( double .infinity)) ,
10581061 alignment: shrinkWrap ? null : style.alignment,
10591062 child: child ??
10601063 StyledText (
0 commit comments