We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
import { JSDOM } from 'jsdom' const html = ` <!doctype html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body> <p>One</p> <span>Two</span> </body> </html> ` const dom = new JSDOM(html) const { document } = dom.window const pOrSpan = document.querySelector('p, span') // correct - it's p console.log( pOrSpan ) // fails if the first option doesn't exist! const divOrSpan = document.querySelector('div, span') // should be span - but it's null! console.log( divOrSpan ) // however, this works const spanOrDiv = document.querySelector('span, div') console.log( spanOrDiv )
In browsers, it selects the second option if the first doesn't exist - and same for previous version of JSDOM
The text was updated successfully, but these errors were encountered:
Thanks for the catch. Fixed upstream.
Please try again with the latest development build of dom-selector.
npm i --save-dev @asamuzakjp/dom-selector@next
Sorry, something went wrong.
Thanks, unfortunately I'm still getting null with the divOrSpan example above after installing latest dom-selector
No branches or pull requests
Basic info:
Minimal reproduction case
How does similar code behave in browsers?
In browsers, it selects the second option if the first doesn't exist - and same for previous version of JSDOM
The text was updated successfully, but these errors were encountered: