Bug Tracker

Modify

Ticket #5607 (closed bug: duplicate)

Opened 4 years ago

Last modified 3 years ago

:contains() selector doesn't support parentheses

Reported by: Sanity Owned by:
Priority: major Milestone: 1.4
Component: selector Version: 1.3.2
Keywords: Cc:
Blocking: Blocked by:

Description

So, it seems I don't actually need quotes when using contains:

$(':contains(foo)') works as expected.

$(':contains("foo")') does the exact same thing.

$(':contains("(foo")') dies with: Syntax error, unrecognized expression: "(assembling")

So I have to wonder, what is the point of the quotes if they don't actually escape anything? Should they be dropped, or should this be fixed to allow parens?

Change History

comment:1 Changed 4 years ago by dmethvin

  • Component changed from unfiled to selector

comment:2 Changed 3 years ago by mynameissam@…

I'm seeing the same issue too. Escaping the parentheses doesn't work. Below is a jsFiddle test case that will replicate the bug:

 http://jsfiddle.net/vXSKm/1/

comment:3 Changed 3 years ago by snover

  • Status changed from new to closed
  • Resolution set to duplicate

comment:4 Changed 3 years ago by snover

Duplicate of #5482.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.