Skip to main content

Search and Top Navigation

#5874 closed bug (notabug)

Opened July 29, 2010 10:29AM UTC

Closed July 29, 2010 11:02AM UTC

Last modified October 11, 2012 09:15PM UTC

escaping in selectors does not work as documented and like ff native impl does

Reported by: gnarkj Owned by:
Priority: major Milestone:
Component: ui.core Version: 1.8.2
Keywords: selector escaping Cc:
Blocked by: Blocking:
Description

according to the jquery doc all "meta-characters: #;&,.+*~':"!^$[]()=>|/" should be escaped. this is all correct. debugging into find() we end up with the native implementation document.querySelectorAll or with sizzle. the first behaves like documented the second does not: backslashes in string are always treated as literals and do not help defining the syntax.

found in jquery-1.4.2 and the nightly build.

use "img[src*=\\\\.gif]" in firebug in firefox on the jquery home page with and without a non-document context to see that it will find the logo with no or a document context utilizing the native .querySelectorAll and that it will find nothing with a body (or any other node) context.

use "img[src*=hallo\\\\]\\\\[ballo]" in any script with a non-document context and debug in ATTR-filter object creation to see that only "hallo" arrives there but we expected "hallo][ballo".

probably this is actually a sizzle bug. but still it needs to be documented here.

the issue refers to escaping questions like these:

http://forum.jquery.com/topic/single-or-double-escaping-difference

Attachments (0)
Change History (3)

Changed July 29, 2010 11:02AM UTC by scottgonzalez comment:1

resolution: → invalid
status: newclosed

Please report this in jQuery core's bug tracker.

Changed July 29, 2010 11:10AM UTC by gnarkj comment:2

whoops ... i thought i was there ... sorry i got confused with the tracking platforms :)

Changed October 11, 2012 09:15PM UTC by scottgonzalez comment:3

milestone: TBD

Milestone TBD deleted