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

HTMLRewriter’s element.setAttribute() method alters the surrounding single quote character #214

Open
Febtw opened this issue Apr 11, 2024 · 0 comments

Comments

@Febtw
Copy link

Febtw commented Apr 11, 2024

I’m using the element.setAttribute() method within Cloudflare Workers’ HTMLRewriter. When attempting to set attributes for HTML elements using this method, if the attribute value is enclosed in single quotes ('), HTMLRewriter converts it to double quotes ("). This results in attribute values being enclosed in double quotes.
Is there any way to keep the original surrounding quotes, after element.setAttribute() sets the attribute?

This issue resembles a similar issue found in cheerio
Maintain tag attribute quote characters · Issue #720 · cheeriojs/cheerio · GitHub
use single quotes for values that contain double quotes

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

No branches or pull requests

1 participant