Skip to content

Commit 380ca5a

Browse files
committed
Remove head from html_elements and fix empty space at the top of the document when using head > style
1 parent b744025 commit 380ca5a

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

lib/html_parser.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ class HtmlParser extends StatelessWidget {
742742
tree.children.forEach((child) {
743743
if (child is EmptyContentElement || child is EmptyLayoutElement) {
744744
toRemove.add(child);
745-
} else if (child is TextContentElement && (child.text!.isEmpty)) {
745+
} else if (child is TextContentElement && (child.text!.trim().isEmpty)) {
746746
toRemove.add(child);
747747
} else if (child is TextContentElement &&
748748
child.style.whiteSpace != WhiteSpace.PRE &&

lib/src/html_elements.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ const INTERACTABLE_ELEMENTS = [
7777
const REPLACED_ELEMENTS = [
7878
"audio",
7979
"br",
80-
"head",
8180
"iframe",
8281
"img",
8382
"svg",

0 commit comments

Comments
 (0)