Open testmigrator opened 1 year ago
The text() method is not handling invalid start tags correctly, resulting in incorrect text output
TEST(test, handlesInvalidStartTags) { std::string html("<html><div>Hello < There <&></div></html>"); HtmlParser parser; shared_ptr<HtmlDocument> doc = parser.Parse(html); std::vector<shared_ptr<HtmlElement>> els = doc->SelectElement("//div"); ASSERT_EQ(1, els.size()); // ASSERT_EQ("Hello < There <&>", els[0]->text()); ASSERT_EQ("Hello ", els[0]->text()); }
The text() method is not handling invalid start tags correctly, resulting in incorrect text output