@@ -, +, @@ a word ("τοῖς") containing Greek diacritics: Book #1 title: Συλλογής των εν επιτομή τοῖς πάλαι γεωγραφηθέντων Book #2 title: Επιτομή της ιστορίας των Βαλκανικών Πολέμων (1912-1913) Then, perform a catalog search for "επιτομή των" (without the quotes). In the results page, notice that: a) the "Highlight"/"Unhighlight" button has disappeared, and b) not all search terms are highlighted (e.g. "των" in the 2nd book) This time the "Highlight"/"Unhighlight" button is displayed normally, and all instances of your search terms are highlighted in the results. --- .../intranet-tmpl/lib/jquery/plugins/jquery.highlight-3.js | 7 ++++--- .../bootstrap/lib/jquery/plugins/jquery.highlight-3.js | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) --- a/koha-tmpl/intranet-tmpl/lib/jquery/plugins/jquery.highlight-3.js +++ a/koha-tmpl/intranet-tmpl/lib/jquery/plugins/jquery.highlight-3.js @@ -1,6 +1,6 @@ /* -highlight v3 +highlight v5 Highlights arbitrary terms. @@ -19,6 +19,7 @@ jQuery.fn.highlight = function(pat) { var skip = 0; if (node.nodeType == 3) { var pos = node.data.toUpperCase().indexOf(pat); + pos -= (node.data.substr(0, pos).toUpperCase().length - node.data.substr(0, pos).length); if (pos >= 0) { var spannode = document.createElement('span'); spannode.className = 'term'; @@ -37,9 +38,9 @@ jQuery.fn.highlight = function(pat) { } return skip; } - return this.each(function() { + return this.length && pat && pat.length ? this.each(function() { innerHighlight(this, pat.toUpperCase()); - }); + }) : this; }; jQuery.fn.removeHighlight = function() { --- a/koha-tmpl/opac-tmpl/bootstrap/lib/jquery/plugins/jquery.highlight-3.js +++ a/koha-tmpl/opac-tmpl/bootstrap/lib/jquery/plugins/jquery.highlight-3.js @@ -1,6 +1,6 @@ /* -highlight v3 +highlight v5 Highlights arbitrary terms. @@ -19,6 +19,7 @@ jQuery.fn.highlight = function(pat) { var skip = 0; if (node.nodeType == 3) { var pos = node.data.toUpperCase().indexOf(pat); + pos -= (node.data.substr(0, pos).toUpperCase().length - node.data.substr(0, pos).length); if (pos >= 0) { var spannode = document.createElement('span'); spannode.className = 'term'; @@ -37,9 +38,9 @@ jQuery.fn.highlight = function(pat) { } return skip; } - return this.each(function() { + return this.length && pat && pat.length ? this.each(function() { innerHighlight(this, pat.toUpperCase()); - }); + }) : this; }; jQuery.fn.removeHighlight = function() { --