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

Add [contains|matches][own]Whole #1636

jhy opened this issue Sep 18, 2021 · 2 comments

Add [contains|matches][own]Whole #1636

jhy opened this issue Sep 18, 2021 · 2 comments


Copy link

jhy commented Sep 18, 2021

After reviewing #876 and the related #576. I think we can make some improvements, and also maintain backwards compatibility:

  • (done) for :contains(text), normalize the selector text in the same way that the text() and ownText() methods work. That directly fixes this issue. I conceptually like the neatness of using :contains("text") to use a non-normalized search, but that's a bit stringly typed, and maybe backwards in-compat.
  • (done) introduce :containsWholeText and :containsWholeOwnText which uses wholeText() and wholeOwnText() and no normalization to either the input or the query. That way we can find content including newlines, tabs, repeated spaces, etc
  • (done) for Can't select elements with only whitespace #576, introduce :matchesWholeText and :matchesWholeOwnText, to work similarly for regular expressions
jhy added a commit that referenced this issue Oct 7, 2021
@jhy jhy self-assigned this Oct 7, 2021
Copy link

@jhy Hi Jon, I'm interested in this ticket. Is this done? Is there anything I can help with for this ticket?

jhy added a commit that referenced this issue Dec 28, 2021
And the corresponding Element#wholeOwnText() method.

For #1636
@jhy jhy added this to the 1.15.1 milestone Dec 28, 2021
@jhy jhy closed this as completed in 4535a57 Dec 28, 2021
Copy link
Owner Author

jhy commented Dec 28, 2021

Thanks @xiaoxianma for your offer; I've completed these, but you're of course welcome to hit up other issues / help with PRs etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

2 participants