-
-
Notifications
You must be signed in to change notification settings - Fork 67
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" incorrectly matches elements #8
Comments
I think the fix would be to change However, I'm not sure. |
This is actually a cheerio issue, as the default DOM returned by my
@matthewmueller Does cheerio need the root element? |
I was wondering about that... |
Having a root simplifies a lot of the top-level logic and allows you to append and prepend on single DOM Nodes. var plum = '<li class="plum">Plum</li>',
apple = '<li class="apple">Apple</li>',
$ = cheerio.load(plum);
$.root().append(apple)
$.html() // <li class="plum">Plum</li><li class="apple">Apple</li> This isn't often necessary in the jquery work because you're not adding things to |
Any idea what the best way to work around this issue is? CSSselect could have special-case code for Cheerio's |
what's your use case for matching |
I'm trying to make the Acid2 test pass in my server-side HTML mangler. |
Did you try the other equivalents: |
I'm running Cheerio on all of the CSS selectors in the test, and this selector is incorrectly matching elements. |
This won't be fixed in CSSselect. I opened a cheerio issue (cheeriojs/cheerio#162), everything else should be discussed there. |
(tested using Cheerio & htmlparser2)
The selector
* html
will incorrectly match the<html>
element, because it picks up the virtualtype: 'root'
element as a parent.* * html
will correctly not match anything.The text was updated successfully, but these errors were encountered: