Skip to content

Problem with / character in html #41

Closed
@ilushka85

Description

@ilushka85

If html code sets an attribute to a string with a / and is not quoted properly then csquery fails to work as shown below. Code in browser works fine.

Sample 1:

          CQ doc = new CQ("<div custattribute=10/23/2012 id=\"tableSample\"><span>sample text</span></div>");
            IDomElement obj = doc["#tableSample"].FirstElement();
        obj equals null, because invalid html was loaded.

Sample 2:

            doc = new CQ("<div custattribute=\"10/23/2012\" id=\"tableSample\"><span>sample text</span></div>");
            obj = doc["#tableSample"].FirstElement();
        obj keeps div element

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions