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

Cannot easily add or remove class #10

Closed
nde-agridea opened this issue May 30, 2017 · 5 comments
Closed

Cannot easily add or remove class #10

nde-agridea opened this issue May 30, 2017 · 5 comments
Assignees

Comments

@nde-agridea
Copy link

The library does not allow to add or remove a class to a tag in an easy and straightforward way. Methods like Node.AddClass() or .RemoveClass() would greatly simplify the operation, instead of fumbling around with the Node.Attributes["class"] HtmlAttribute. Classes should be treated as first class citizens IMHO. Please add these in the API.

@JonathanMagnan JonathanMagnan self-assigned this May 30, 2017
@JonathanMagnan
Copy link
Member

Hello @nde-agridea ,

You are 100% right. A lot of good methods which could easily make the code easier are missing.

We are currently mainly focusing on adding documentation: http://html-agility-pack.net/api

But we also add from time to time new methods && options. By example, a change I believe will happen soon will be to support CSS selector as jQuery do.

I will check this request during the weekend and will let you know when we will implement it if it's not implemented during the weekend.

Best Regards,

Jonathan

@JonathanMagnan
Copy link
Member

Hello @nde-agridea ,

Sorry for the delay, it seem I forget to answer you.

Class helper has been added today, it should be available within a few hours.

Best Regards,

Jonathan

@JonathanMagnan
Copy link
Member

Hello @jonalbrecht ,

The version v1.5.0-beta9 has been released:
https://www.nuget.org/packages/HtmlAgilityPack/1.5.0-beta9

We added the following helper:

  • AddClass
  • RemoveClass
  • ReplaceClass

Let us know if these helpers are what you were looking for.

Best Regards,

Jonathan

@nde-agridea
Copy link
Author

nde-agridea commented Jun 19, 2017 via email

@JonathanMagnan
Copy link
Member

Closing comment: version released.

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