Opened 11 years ago
Closed 11 years ago
#11644 closed bug (invalid)
The 'attribute does not equal' selector fails to process escaped quotation marks whereas the 'attribute equals' selector does.
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.5.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
The following 'attribute equals' selector executes sucessfully and finds results:
$("[label=\"Amy\\'s Shoe\"]")
However the same argument for the 'attribute does not equal' selector fails:
$("[label!=\"Amy\\'s Shoe\"]")
With:
Syntax error, unrecognized expression: Shoe"]
The simplest failing example is:
$("[label!=\"\\'"]")
Clearly this is inconsistent and I think the escaping should work. I am yet to experiment with entity encoded strings.
Change History (4)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
Owner: | set to [email protected]… |
---|---|
Status: | new → pending |
Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket.
Additionally, be sure to test against the jQuery Edge version to ensure the issue still exists. To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to get started.
comment:3 Changed 11 years ago by
This is most likely because [attr=value]
is standard CSS and processed by querySelectorAll
but [attr!=value]
is a jQuery selector extension so it goes through an entirely different code path. A thorough test case with all your experiments would be appreciated.
comment:4 Changed 11 years ago by
Resolution: | → invalid |
---|---|
Status: | pending → closed |
Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!
I have since tried:
But this selector does not find the element with the label "Amy's Shoe", even though it appears in the literal source with the entity escaping form (as <optgroup label="Amy's Shoe">). Whereas the following does find the element:
So I surmise that I cannot rely on the entity escaped form for the 'attribute does not equal' selector either.