Skip to content

Script tag not handled properly when escaped #4

@testmigrator

Description

@testmigrator

The expected value of els[0]->GetValue() is not returned, when handling escaped script, which leads to incorrect parsing.

TEST(test, handlesEscapedScript) {
    HtmlParser parser;
    shared_ptr<HtmlDocument> doc = parser.Parse("<html><script><!-- one <script>Blah</script> --></script></html>");
    vector<shared_ptr<HtmlElement>> els = doc->SelectElement("//script");
    ASSERT_EQ(1, els.size());
    // <!-- one <script>Blah
    // ASSERT_EQ("<!-- one <script>Blah</script> -->", els[0]->GetValue());
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions