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

Pseudo argument unquoted fallback yields strange behavior #264

Closed
gibson042 opened this issue May 22, 2014 · 3 comments
Closed

Pseudo argument unquoted fallback yields strange behavior #264

gibson042 opened this issue May 22, 2014 · 3 comments

Comments

@gibson042
Copy link
Member

cc @timmywil

Spun off from #261.

Our current pseudo argument parser prefers quotes, but will fall back on greedy consumption up to the last closing parenthesis if they are not found or incorrect. We should decide on explicit behavior.

Selector Liberal Fallback (current)
unclosed: :contains(... Syntax Error
no quotes: :contains(Too Ra Loo Ra Loo Ral) Too Ra Loo Ra Loo Ral
parentheses: :contains(:-)) :-)
properly quoted: :contains('\'sup?') 'sup?
leading quote: :contains("foo" is bar) "foo" is bar
leading quote: :contains("unterminated) "unterminated
trailing quote: :contains(Quoth the raven, 'Nevermore.') Quoth the raven, 'Nevermore.'
trailing quote: :contains(unopened') unopened'
embedded quote: :contains(It's a bird, it's a plane) It's a bird, it's a plane

Other options to come later; I just wanted to document a wide swath of cases. Note also that our current aggressiveness can cause problems with subsequent selector components (e.g., we accept :contains("unterminated):not(:contains("Terminator")) as valid, and matching only elements containing "unterminated):not(:contains("Terminator")).

@timmywil
Copy link
Member

I think the current behavior is best. We can continue to recommend quotes, but will try to fall back to a working value. I know it messes up certain cases, but at least not finding anything should be a clue that the selector might have something wrong with it.

@mgol
Copy link
Member

mgol commented Sep 7, 2023

@timmywil @gibson042 are there any changes here that you'd eventually want to apply to jQuery or are we fine to close this issue?

@mgol mgol added the Discuss in Meeting Reserved for Issues and PRs that anyone would like to discuss in the weekly meeting. label Sep 7, 2023
@timmywil timmywil added Discuss in Meeting Reserved for Issues and PRs that anyone would like to discuss in the weekly meeting. and removed Discuss in Meeting Reserved for Issues and PRs that anyone would like to discuss in the weekly meeting. labels Sep 11, 2023
@mgol
Copy link
Member

mgol commented Sep 12, 2023

Closing as discussed during the last team meeting

@mgol mgol closed this as not planned Won't fix, can't repro, duplicate, stale Sep 12, 2023
@mgol mgol removed the Discuss in Meeting Reserved for Issues and PRs that anyone would like to discuss in the weekly meeting. label Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants