You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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")).
The text was updated successfully, but these errors were encountered:
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.
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
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.
:contains(...
:contains(Too Ra Loo Ra Loo Ral)
Too Ra Loo Ra Loo Ral
:contains(:-))
:-)
:contains('\'sup?')
'sup?
:contains("foo" is bar)
"foo" is bar
:contains("unterminated)
"unterminated
:contains(Quoth the raven, 'Nevermore.')
Quoth the raven, 'Nevermore.'
:contains(unopened')
unopened'
: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")
).The text was updated successfully, but these errors were encountered: