html-agility-pack
html-agility-pack copied to clipboard
IsOverlappedClosingElement: Incorrect Length Check for Minimal Tags
The current implementation includes the following check:
if (text.Length <= 4)
return false;
This condition inadvertently excludes valid minimal closing tags like or , which have a length of exactly 4 characters. To accurately assess such tags, the condition should be adjusted to:
if (text.Length < 4)
return false;
This change ensures that tags with a length of 4 are properly evaluated.
HtmlNode.IsOverlappedClosingElement("</b>"); // Returns false, but should return true