File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -944,13 +944,17 @@ class HtmlParser extends StatelessWidget {
944
944
if (child is EmptyContentElement || child is EmptyLayoutElement ) {
945
945
toRemove.add (child);
946
946
} else if (child is TextContentElement
947
- && child.text! .trim ().isEmpty
947
+ && tree.name == "body"
948
+ && child.text! .trim ().isEmpty) {
949
+ toRemove.add (child);
950
+ } else if (child is TextContentElement
951
+ && child.text! .isEmpty
948
952
&& child.style.whiteSpace != WhiteSpace .PRE ) {
949
953
toRemove.add (child);
950
954
} else if (child is TextContentElement &&
951
955
child.style.whiteSpace != WhiteSpace .PRE &&
952
956
tree.style.display == Display .BLOCK &&
953
- child.text! .trim (). isEmpty &&
957
+ child.text! .isEmpty &&
954
958
lastChildBlock) {
955
959
toRemove.add (child);
956
960
} else if (child.style.display == Display .NONE ) {
You can’t perform that action at this time.
0 commit comments