Skip to content

Commit 6788a56

Browse files
authored
Merge pull request #646 from tneotia/bugfix/empty-block-element
Fix empty space when there are empty block elements in the HTML
2 parents 1133dc9 + 9192f93 commit 6788a56

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
@@ -317,7 +317,7 @@ class HtmlParser extends StatelessWidget {
317317
}
318318

319319
//Return the correct InlineSpan based on the element type.
320-
if (tree.style.display == Display.BLOCK) {
320+
if (tree.style.display == Display.BLOCK && tree.children.isNotEmpty) {
321321
return WidgetSpan(
322322
child: ContainerSpan(
323323
key: AnchorKey.of(key, tree),

0 commit comments

Comments
 (0)