WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. nich008
    Member
    Posted 3 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">
    ...
    </select>'

    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' >
    ...
    </select>'
    which of course breaks the <select>

    Anything I can do to stop this highlighting?

    http://wordpress.org/extend/plugins/relevanssi/

  2. Mikko Saari
    Member
    Plugin Author

    Posted 3 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

About this Topic

Tags