diff options
Diffstat (limited to 'lib/sisu/v3/cgi_sql_common.rb')
-rw-r--r-- | lib/sisu/v3/cgi_sql_common.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/sisu/v3/cgi_sql_common.rb b/lib/sisu/v3/cgi_sql_common.rb index 5a044d5f..94026ce7 100644 --- a/lib/sisu/v3/cgi_sql_common.rb +++ b/lib/sisu/v3/cgi_sql_common.rb @@ -1024,8 +1024,9 @@ module SiSU_CGI_SQL if cgi['view']=~/text/ \ or (cgi['view']!~/index/ and cgi['search'] !~/search db/) #% txt endnotes @counter_endn_ocn+=1 - matched_endnote=(@search_regx.to_s.class==String && @search_regx.to_s=~/\S\S+/) \ - ? matched=e['body'].gsub(/(<a\s+href="https?:\/\/[^><\s]+#{@search_regx}[^>]+?>|#{@search_regx})/mi,%{<span style="background-color: #{@color_match}">\\1</span>}) + matched_endnote=(@search_regx.to_s.is_a?(String) \ + && @search_regx.to_s=~/\S\S+/) \ + ? (matched=e['body'].gsub(/(<a\s+href="https?:\/\/[^><\s]+#{@search_regx}[^>]+?>|#{@search_regx})/mi,%{<span style="background-color: #{@color_match}">\\1</span>})) : e['body'] output=%{#{title}<hr><font size="2">note <b><a href="#{path_endnotes(location,@ln)}#_#{e['nr']}">#{e['nr']}</a></b> referred to from ocn <a href="#{path_html_doc(location,@ln)}##{e['ocn']}">#{e['ocn']}</a>:</font> #{matched_endnote}} else #elsif cgi['view']=~/index/ #doc #FIX #% idx endnotes |