zzzprojects/html-agility-pack

Setting InnerHtml does not assign OwnerDocument to new nodes correctly

afarchy opened this issue · 2 comments

After assigning a node's InnerHtml, the _ownerDocument of the new nodes are is incorrect, since it is set to the temporary HtmlDocument created in the InnerHtml set method.

If I then attempt to assign InnerHtml to those new child nodes, the original owner document doesn't get updated correctly with those child IDs, causing GetElementbyId to fail.

Fiddle: https://dotnetfiddle.net/pZzjFh

Hello @afarchy ,

Thank you for reporting. Our developer proposed a fix that we are currently reviewing.

So a fix should be available soon.


Sponsorship
Help us improve this library

Performance Libraries
context.BulkInsert(list, options => options.BatchSize = 1000);
Entity Framework ExtensionsDapper Plus

Runtime Evaluation
Eval.Execute("x + y", new {x = 1, y = 2}); // return 3
C# Eval Function

Hello @afarchy ,

The v1.11.52 has been released.

The fix we did has not fixed the _ownerDocument mismatch but will fix the issue you reported.

Best Regards,

Jon


Are you finding this library useful? If so, please consider supporting its continued development by becoming a sponsor.

Additionally, if you think your enterprise would benefit from this library, we encourage you to suggest they become a sponsor as well. Your support will help ensure this library remains alive and well-supported.