From afa11387072a33dd8dbca54eeee6ae9bcd789f81 Mon Sep 17 00:00:00 2001 From: renato <renato@rezo.net> Date: Fri, 9 Jan 2009 20:59:35 +0000 Subject: [PATCH] les entitee > et < etaint changee en < > apres une surligne. Corrige #1693 --- prive/javascript/SearchHighlight.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/prive/javascript/SearchHighlight.js b/prive/javascript/SearchHighlight.js index 013e650d31..5eddcf032c 100644 --- a/prive/javascript/SearchHighlight.js +++ b/prive/javascript/SearchHighlight.js @@ -6,7 +6,7 @@ * * @author Renato Formato <renatoformato@virgilio.it> * - * @version 0.35 + * @version 0.36 (9/1/2009) * * Options * - exact (string, default:"exact") @@ -195,13 +195,13 @@ if (window.jQuery) var newtext="",match,index=0; SearchHighlight.regex.lastIndex = 0; while(match = SearchHighlight.regex.exec(textNoAcc)) { - newtext += text.substr(index,match.index-index)+'<span class="'+ - SearchHighlight.subs[match[matchIndex].toLowerCase()]+'">'+text.substr(match.index,match[0].length)+"</span>"; + newtext += SearchHighlight.fixTags(text.substr(index,match.index-index))+'<span class="'+ + SearchHighlight.subs[match[matchIndex].toLowerCase()]+'">'+SearchHighlight.fixTags(text.substr(match.index,match[0].length))+"</span>"; index = match.index+match[0].length; } if(newtext) { //add the last part of the text - newtext += text.substring(index); + newtext += SearchHighlight.fixTags(text.substring(index)); var repl = $.merge([],$("<span>"+newtext+"</span>")[0].childNodes); endIndex += repl.length-1; startIndex += repl.length-1; @@ -213,6 +213,9 @@ if (window.jQuery) } } } + }, + fixTags : function(text) { + return text.replace("<","<").replace(">",">"); } }; })(jQuery) -- GitLab