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

case-insensitive attribute option #48

Open
wildthink opened this issue Nov 5, 2015 · 1 comment
Open

case-insensitive attribute option #48

wildthink opened this issue Nov 5, 2015 · 1 comment

Comments

@wildthink
Copy link

I've encountered a problem when I need to do a case-insensitive attribute match

As discussed here
http://stackoverflow.com/questions/5671238/css-selector-case-insensitive-for-attributes

Shouldn't these be equivalent?

let nodes = doc.firstNodeMatchingSelector("link[rel='shortcut icon']")

and

let nodes = doc.firstNodeMatchingSelector("link[rel='Shortcut icon' i]")

@nolanw
Copy link
Owner

nolanw commented Nov 5, 2015

Hello! Unfortunately HTMLReader doesn't support that flag, at least not yet. HTMLReader aims to support CSS Selectors Level 3, and that little i is part of Selectors Level 4, and I haven't gotten there yet.

It's a good idea to add it, though! I'll keep this issue open to track progress.

In the meantime, I'm afraid you're stuck with a workaround like that mentioned in the question you linked: you can run through all the link elements and check all its attributes in your preferred case-insensitive manner.

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

No branches or pull requests

2 participants