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

html isn't the root of the document #162

Closed
fb55 opened this issue Feb 15, 2013 · 5 comments · Fixed by #1559
Closed

html isn't the root of the document #162

fb55 opened this issue Feb 15, 2013 · 5 comments · Fixed by #1559
Labels

Comments

@fb55
Copy link
Member

fb55 commented Feb 15, 2013

fb55/css-select#8 should be handled here. The issue is that selectors such as * html match elements. This won't be fixed in CSSselect, so I'm moving it here.

@ELLIOTTCABLE
Copy link

I'm running into this issue. I'm trying to write code that's portable between jQuery and cheerio; and it's becoming difficult, because I can't find a portable and performant way to acquire the root element. Cheerio wants $.root(), whereas jQuery wants $(':root') or $(':eq(0)').

@fb55
Copy link
Member Author

fb55 commented Apr 8, 2013

@ELLIOTTCABLE How about $("html")? Some documents won't have it, but that shouldn't be too bad.

@ELLIOTTCABLE
Copy link

@fb55 that's what I'm doing right now, but I tend to want to write “correct” code. What I'm truly looking for here is to acquire the root of any document it may be processing, and that seems to be too hard-coded for my tastes. Make sense?

Either way, it's something worth fixing, even if there's a passable way around it like that.

@jugglinmike
Copy link
Member

Resolved via commit 7c07fac

@fb55
Copy link
Member Author

fb55 commented Apr 8, 2014

This actually isn't fixed. CSSselect's :root, as well as .root(), don't behave as expected.

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

Successfully merging a pull request may close this issue.

3 participants