Relevanssi - A Better Search
Search term highlight in code (2 posts)

  1. nich008
    Posted 4 years ago #

    Great plugin, thanks.
    One small issue - I have a dropdown select box on some items being searched, and when I select highlighting things break. For example this:

    '<select title="Click on a document from list below - will open in new tab or window" onchange="if((this.options[this.selectedIndex].value)!="Highline 300i specification documents:")window.open(this.options[this.selectedIndex].value);return false">

    if I search for 'highline' with highlighting on becomes:

    '<select title="Click on a document from list below - will open in new tab or window" onchange="if((this.options[this.selectedIndex].value)!="<span style=" background-color:="" #ffff00'="">Highline 300i specification documents:")window.open(this.options[this.selectedIndex].value);return false' >
    which of course breaks the <select>

    Anything I can do to stop this highlighting?


  2. Mikko Saari
    Plugin Author

    Posted 4 years ago #

    The highlighting is done with a regexp that should not highlight anything inside a HTML tag. When I test the regexp at RegexPal with your HTML, it doesn't highlight inside the select tag.

    So, either you're using an older version of Relevanssi without this better regexp for highlighting or there's something odd on your system breaking the way the regexp should work.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Relevanssi - A Better Search
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic