pantheon-systems / solr-power

A WordPress plugin to connect to Pantheon's Apache Solr search infrastructure, or your own!
https://wordpress.org/plugins/solr-power/
GNU General Public License v2.0
126 stars 60 forks source link

Switch to wp_strip_all_tags() to remove style and script tag content #500

Closed PatelUtkarsh closed 3 years ago

PatelUtkarsh commented 3 years ago

strip_tags preserve content from style and script tags, Some of the Gutenberg blocks like to have inline script / style which appears in search results.

danielbachhuber commented 3 years ago

Hey @PatelUtkarsh !

strip_tags preserve content from style and script tags, Some of the Gutenberg blocks like to have inline script / style which appears in search results.

I'm not 100% I understand. Can you share an example of what you're trying to solve for?

PatelUtkarsh commented 3 years ago

Hello @danielbachhuber :)

We are having a style tag as the starting of the post_content which results in an output of style as the post doesn't have post_excerpt details filled in causing style content to show up in the result when using with solr.

Example difference:

wp_strip_all_tags('')

Outputs to '' (empty string)

strip_tags('');

Outputs to .bold{ font-weight: 700; }