diff --git a/ecrire/inc/surligne.php b/ecrire/inc/surligne.php index 12ca3feea736861020f6364d1080bb8283cfab6e..44e9a9fffd54f1f75cb9ccce25c7581196e29b69 100644 --- a/ecrire/inc/surligne.php +++ b/ecrire/inc/surligne.php @@ -74,9 +74,10 @@ function surligner_mots($page, $surcharge_surligne = '') { $script = " <script type='text/javascript' src='" . url_absolue(find_in_path('javascript/SearchHighlight.js')) . "'></script> <script type='text/javascript'>/*<![CDATA[*/ - if (window.jQuery) - (function(\$){\$(function(){ - \$(document).SearchHighlight({ + if (window.jQuery) { + var highlighter = function() { + jQuery(function($){ + \$(document).SearchHighlight({ tag_name:'" . (html5_permis() ? 'mark' : 'span') . "', style_name:'spip_surligne', exact:'whole', @@ -86,10 +87,13 @@ function surligner_mots($page, $surcharge_surligne = '') { nohighlight:'.pas_surlignable'" . ($surcharge_surligne ? ", keys:'$surcharge_surligne'" : '') . ', - min_length: 3 - }) - }); - })(jQuery); + min_length: 3 + }); + }); + } + highlighter(); + onAjaxLoad(highlighter); + }(jQuery); /*]]>*/</script> '; // on l'insere juste avant </head>, sinon tout en bas