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

Setting node name seems to work only partially #497

Closed
arekdygas opened this issue May 9, 2023 · 5 comments
Closed

Setting node name seems to work only partially #497

arekdygas opened this issue May 9, 2023 · 5 comments
Assignees

Comments

@arekdygas
Copy link

arekdygas commented May 9, 2023

1. Description

When I execute the following code:

var node = HtmlNode.CreateNode("<div data-num=\"10\">aaa</div>");
//node.Attributes.Remove("data-num");
node.Name = "p";
Console.WriteLine(node.Name);
Console.WriteLine(node.OuterHtml);

node.Name is correctly displayed as p, but there's still div in OuterHtml. But after uncommenting the line with attribute removal, this works correctly.

I suspect this has something to do with setting _changed flag, which is not called on Name setter.

2. Exception

--

3. Fiddle or Project

https://dotnetfiddle.net/6s8zO7

4. Any further technical details

  • HAP version: 1.11.46
  • NET version 4.8
@JonathanMagnan JonathanMagnan self-assigned this May 9, 2023
@JonathanMagnan
Copy link
Member

Hello @arekdygas ,

Thank you for reporting.

We will look at it.

Best Regards,

Jon


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

@JonathanMagnan
Copy link
Member

Hello @arekdygas ,

Sorry for the long delay.

This issue has been fixed in the v1.11.47

Let me know if everything now works as expected.

Best Regards,

Jon

@arekdygas
Copy link
Author

Hello @JonathanMagnan ,

Looking at the code changes, it's probably fixed, but my test failed again, because you uploaded version 46 as 47 to nuget ;)

Best regards,
Arek

@JonathanMagnan
Copy link
Member

Hello @arekdygas ,

100% my mistake! The v1.11.48 has been released with the right assembly version and with the fix this time ;)

Best Regards,

Jon

@arekdygas
Copy link
Author

Fixed now - thanks! :)

Best regards,
Arek

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

2 participants