Jump to content

Recommended Posts

Posted

Hello girls and guys,

i just saw that if I use a selector on a textarea, for example 

$pages->find('body%=notes')

it also find that key in html classes and attributes. For example it will find

<p class="text-notes">Lorem ipsum dolor sit amet cosectetur.</p>

Is there a way to avoid this anche check only the texts without the html tags?

Thanks!

Posted

I don't think that it is possible. 
As a workaround, you can create additional textarea field where you will populate all sanitized content and then search by this field. 

Posted

hmm... I don't think that's expected behavior.  With more and more developers using data-attributes etc., why should CSS classes etc. show up in a website search result?

With so many things PW does really really well, I'm surprised (I never noticed it though - probably because most sites I build are in German, and I only use English variables, data-attributes and CSS classes / IDs).

Posted

I can confirm the result and behaviour on a local PW 3.0.98 but never saw that anywhere before.

As @dragan already mentioned: my site's content is most of the time in german, while classes are in english as well.

 

Posted

Thanks guys, I also have some multilanguage website, but some words can be the same in all languages (for example: "note", that it is my case).

If there is no solution to that maybe it's good to keep in mind not to use common words as classes or data-attributes in textarea. 

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...