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

Enforce single quotes instead of double quotes for attributes #15

Closed
lavkumarv opened this issue Aug 22, 2017 · 2 comments
Closed

Enforce single quotes instead of double quotes for attributes #15

lavkumarv opened this issue Aug 22, 2017 · 2 comments
Assignees

Comments

@lavkumarv
Copy link

Hi,
This library works fine for all my use cases. But for some cases, I need to add the HTML attribute in single quotes instead of double.

Like
original string <a href='www.example.com'>
after setting target attribute it becomes <a href='www.example.com' target="_blank">
but need <a href='www.example.com' target='_blank'>

Do you have any option to do it?

@cakkermans cakkermans changed the title Use Single quotes instead of double Enforce single quotes instead of double quotes for attributes Apr 1, 2023
@cakkermans
Copy link
Contributor

Unfortunately there is no feature to do this. The HTML5 standard allows single, double and no quotes on attributes, so there is nothing wrong with them.

The HtmlAgilityPack does seem to be able to read and control the quote type on attributes using HtmlAttribute.QuoteType, so I think this feature could be developed.

@cakkermans cakkermans self-assigned this Oct 24, 2023
@cakkermans
Copy link
Contributor

This feature was implemented in version 1.8 and is now available

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

When branches are created from issues, their pull requests are automatically linked.

2 participants