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

decodeEntities will escape href's of a tags #960

Closed
wisko opened this issue Jan 4, 2017 · 2 comments
Closed

decodeEntities will escape href's of a tags #960

wisko opened this issue Jan 4, 2017 · 2 comments

Comments

@wisko
Copy link

wisko commented Jan 4, 2017

If an A-tag href attribute includes parameter names that are valid, but with unfortunate names, they get html-decoded by cheerio.

Example:

require('cheerio').load('<a href="/?param=value&reg_number=123">')('a').attr('href');

will output:

/?param=value®number=123

Either the bug lies in &reg_ getting the same treatment as &reg;, or perhaps the href attribute shouldn't be decoded at all.

If the load() option decodeEntities is set to false this does not happen, so perhaps this bug lies in a cheerio dependency?

@ioandev
Copy link

ioandev commented Jun 3, 2020

#720
is this fixing it?

@fb55
Copy link
Member

fb55 commented Sep 1, 2020

This is actually in-line with browser behavior 😄

@fb55 fb55 closed this as completed Sep 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants