Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

</form> is recognized as a Text node #45

Closed
osjoberg opened this issue Jul 18, 2017 · 6 comments
Closed

</form> is recognized as a Text node #45

osjoberg opened this issue Jul 18, 2017 · 6 comments
Assignees

Comments

@osjoberg
Copy link

osjoberg commented Jul 18, 2017

Hello!

When parsing html </form> is recognized as a #text node.

Small repro.

var document = new HtmlDocument();
document.LoadHtml("<div></div>");
var result = document.DocumentNode.Descendants().Select(dn => new { dn.NodeType, dn.Name, dn.OuterHtml }).ToArray();

Result contains:

new [] 
{
    new { NodeType = HtmlNodetype.Element, Name = "div", OuterHtml = "<div></div>" }
}

Seems reasonable, however changing "<div></div>" to "<form></form>" in the repro above yields an unexpected output

new [] 
{
    new { NodeType = HtmlNodeType.Element, Name = "form", OuterHtml = "<form>" },
    new { NodeType = HtmlNodeType.Text, Name = "#text", OuterHtml = "</form>" }
}

Obviously my real scenario has a full HTML document, with html, head, body, etc, but the error stays the same.

@JonathanMagnan JonathanMagnan self-assigned this Jul 18, 2017
@JonathanMagnan
Copy link
Member

Hello @osjoberg ,

Thank you for reporting,

We will look at this issue.

Best Regards,

Jonathan

@Tarmil
Copy link

Tarmil commented Jul 31, 2017

Hi @JonathanMagnan, I am a developer of the WebSharper web framework for F#. We are using HtmlAgilityPack for our templating engine, and we are being hit by this and #48. Is there any ETA for a fix on these issues?

JonathanMagnan added a commit that referenced this issue Jul 31, 2017
fix for #45 </form> is recognized as a Text node
@JonathanMagnan
Copy link
Member

Hello @Tarmil ,

My developer provided me a pull request yesterday.

I'm currently checking the side effect of this pull request.

If there is nothing wrong, it should be released probably Wednesday.

Best Regards,

Jonathan

@Tarmil
Copy link

Tarmil commented Aug 1, 2017

That's great news, thanks!

@JonathanMagnan
Copy link
Member

Hello @osjoberg , @Tarmil ,

The issue should be fixed, the Form is no longer recognized with an flag Empty

Soon, we will rework the logic to fix all this kind of issue with tag.

Best Regards,

Jonathan

@JonathanMagnan
Copy link
Member

Hello @osjoberg , @Tarmil ,

We will close this issue since it should be fixed.

Feel free to re-open if you still have this issue.

Best Regards,

Jonathan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants