Search hit highlighting breaks content
-
Hey Mikko,
I am running into my first issue (ever, since using this plugin on 10+ websites) today. Hopefully you are able to help me figure this out.
On my website, I am using the search hit highlighting in my body. This works fine generally speaking. It does however, also break some markup on my website when I am using Gutenburg preformatted blocks.
This is an example of the code I should see (without highlighting enabled):
<pre class="wp-block-preformatted"><a href="https://demo.com/" class="external external_icon" target="_blank" rel="noreferrer noopener" aria-label=" (opens in a new tab)">https://demo.com/</a></pre>
This is what the output looks like with highlighting enabled:
<pre class="wp-block-preformatted">& lt;a href="https://demo.com/" class="external external_icon" target="_blank" rel="noreferrer noopener" aria-label=" (opens in a new tab)"& gt;https://demo.com/</a& gt;</pre>
(I had to add spaces in order for WordPress to process it right)Notice how the
<a>
tag is sanitized in the 2nd result. Can I prevent this from happening? That way, the URL would keep working :).Thanks in advance!
Rob
- The topic ‘Search hit highlighting breaks content’ is closed to new replies.