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

.prop('outerHTML') returns undefined #944

Closed
bill-bishop opened this issue Nov 23, 2016 · 5 comments
Closed

.prop('outerHTML') returns undefined #944

bill-bishop opened this issue Nov 23, 2016 · 5 comments

Comments

@bill-bishop
Copy link
Contributor

cheerio:
require('cheerio').load('<div></div>')('div').prop('outerHTML') // undefined

jQuery:
$('<div></div>').prop('outerHTML') // '<div></div>'

i have implemented a fix which adds a switch case for 'outerHTML' in the exports.prop function within lib/attributes.js which uses the following implementation: this.clone().wrap('<container />').parent().html()

I will make a pull request, please let me know your thoughts.

@gajus
Copy link

gajus commented Mar 15, 2017

I will make a pull request, please let me know your thoughts.

Any updates on this?

@bill-bishop
Copy link
Contributor Author

bill-bishop commented Mar 27, 2017

I made the fix & PR back in November but it hasn't been pulled yet. you could point to a forked repo: npm install cheerio@https://github.com/william-mcmillian/cheerio.git until the fix is pulled into cheeriojs:master

@fb55 fb55 closed this as completed Mar 29, 2018
@evandrix
Copy link

evandrix commented May 1, 2018

bump

@gajus
Copy link

gajus commented May 8, 2018

This remains to be an issue.

@ash0080
Copy link

ash0080 commented Mar 21, 2020

$(this).prop('outerHTML') return undefined also

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

5 participants