Skip to content

Commit 9192f93

Browse files
committed
Fix empty space when there are empty block elements in the HTML
1 parent 0874d55 commit 9192f93

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/html_parser.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ class HtmlParser extends StatelessWidget {
278278
}
279279

280280
//Return the correct InlineSpan based on the element type.
281-
if (tree.style.display == Display.BLOCK) {
281+
if (tree.style.display == Display.BLOCK && tree.children.isNotEmpty) {
282282
return WidgetSpan(
283283
child: ContainerSpan(
284284
key: AnchorKey.of(key, tree),

0 commit comments

Comments
 (0)