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
Given the html: <html><body><p> </p></body></html>
:matchesOwn(^\s+$) won't select it because element.ownText() performs a trim() on the text before testing it against the regex pattern.
Because of this, :matchesOwn(^$) will select it along with everything else that has no text nodes
Furthermore, MatchesOwn.matches() uses Matcher.find() when it seems that Matcher.matches() would be more appropriate.
I think that adding a method like Element.fullText() which MatchesOwn.matches() could call and changing it to use Matcher.matches() would be an easy solution. Not sure if I am missing any reasons that it was implemented in this way.
The text was updated successfully, but these errors were encountered:
I may have tripped over that issue myself today...
I was going to ask if it is possible to add a pseudo selector for :isBlock and :empty as they do have methods but that requires breaking out into a for loop to access them. (I'm in Scala and have overriden a class and forloops are brutal if you can't get the underlying elements into the right "collection").
Having these pseudo selectors would help eliminate the need for extra code when the need for logic related to "empty" elements arises.
If we added those then of course :isNotEmpty and :isNotBlock would just make sense...
Given the html:
<html><body><p> </p></body></html>
:matchesOwn(^\s+$) won't select it because element.ownText() performs a trim() on the text before testing it against the regex pattern.
Because of this, :matchesOwn(^$) will select it along with everything else that has no text nodes
Furthermore, MatchesOwn.matches() uses Matcher.find() when it seems that Matcher.matches() would be more appropriate.
I think that adding a method like Element.fullText() which MatchesOwn.matches() could call and changing it to use Matcher.matches() would be an easy solution. Not sure if I am missing any reasons that it was implemented in this way.
The text was updated successfully, but these errors were encountered: