From f208514db14ef163d2f189700ad305555ab386f8 Mon Sep 17 00:00:00 2001 From: Dylan Streb Date: Wed, 14 Aug 2024 09:20:05 -0400 Subject: [PATCH] Add tfoot to appropriate fields in IsParentExplicitEnd --- src/HtmlAgilityPack.Shared/HtmlDocument.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/HtmlAgilityPack.Shared/HtmlDocument.cs b/src/HtmlAgilityPack.Shared/HtmlDocument.cs index e64c0a0..34cd7ca 100644 --- a/src/HtmlAgilityPack.Shared/HtmlDocument.cs +++ b/src/HtmlAgilityPack.Shared/HtmlDocument.cs @@ -1956,19 +1956,19 @@ private bool IsParentExplicitEnd() isExplicitEnd = nodeName == "table"; break; case "tr": - isExplicitEnd = nodeName == "tr" || nodeName == "tbody"; + isExplicitEnd = nodeName == "tr" || nodeName == "thead" || nodeName == "tbody" || nodeName == "tfoot"; break; case "thead": - isExplicitEnd = nodeName == "tbody"; + isExplicitEnd = nodeName == "tbody" || nodeName == "tfoot"; break; case "tbody": - isExplicitEnd = nodeName == "tbody"; + isExplicitEnd = nodeName == "tbody" || nodeName == "tfoot"; break; case "td": - isExplicitEnd = nodeName == "td" || nodeName == "th" || nodeName == "tr" || nodeName == "tbody"; + isExplicitEnd = nodeName == "td" || nodeName == "th" || nodeName == "tr" || nodeName == "tbody" || nodeName == "tfoot"; break; case "th": - isExplicitEnd = nodeName == "td" || nodeName == "th" || nodeName == "tr" || nodeName == "tbody"; + isExplicitEnd = nodeName == "td" || nodeName == "th" || nodeName == "tr" || nodeName == "tbody" || nodeName == "tfoot"; break; case "h1": isExplicitEnd = nodeName == "h2" || nodeName == "h3" || nodeName == "h4" || nodeName == "h5";