HTMLReader
HTMLReader copied to clipboard
case-insensitive attribute option
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]")
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.