Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/html_parser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ class HtmlParser extends StatelessWidget {
if (child is EmptyContentElement || child is EmptyLayoutElement) {
toRemove.add(child);
} else if (child is TextContentElement
&& tree.name == "body"
&& (tree.name == "body" || tree.name == "ul")
&& child.text!.replaceAll(' ', '').isEmpty) {
toRemove.add(child);
} else if (child is TextContentElement
Expand Down
6 changes: 6 additions & 0 deletions lib/src/layout_element.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class TableLayoutElement extends LayoutElement {
key: AnchorKey.of(context.parser.key, this),
margin: style.margin,
padding: style.padding,
alignment: style.alignment,
decoration: BoxDecoration(
color: style.backgroundColor,
border: style.border,
Expand Down Expand Up @@ -155,6 +156,11 @@ class TableLayoutElement extends LayoutElement {
max(0, columnMax - finalColumnSizes.length),
(_) => IntrinsicContentTrackSize());

if (finalColumnSizes.isEmpty || rowSizes.isEmpty) {
// No actual cells to show
return SizedBox();
}

return LayoutGrid(
gridFit: GridFit.loose,
columnSizes: finalColumnSizes,
Expand Down