verdeandrea Posted May 8, 2018 Share Posted May 8, 2018 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! Link to comment Share on other sites More sharing options...
Zeka Posted May 8, 2018 Share Posted May 8, 2018 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. Link to comment Share on other sites More sharing options...
dragan Posted May 8, 2018 Share Posted May 8, 2018 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). Link to comment Share on other sites More sharing options...
wbmnfktr Posted May 8, 2018 Share Posted May 8, 2018 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. Link to comment Share on other sites More sharing options...
verdeandrea Posted May 9, 2018 Author Share Posted May 9, 2018 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. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now