lib/milkode/cdweb/lib/search_files.rb in milkode-1.1.0 vs lib/milkode/cdweb/lib/search_files.rb in milkode-1.2.0
- old
+ new
@@ -76,11 +76,14 @@
def pagination_span(content)
"<ul><li>#{content}</li></ul>\n"
end
def result_record(record)
+ filename = Util::relative_path(record.shortpath, @path).to_s
+ filename = Util::highlight_keywords(filename, @q.fpaths + @q.fpath_or_packages, 'highlight-filename')
+
<<EOS
- <dt class='result-file'>#{file_or_dirimg(true, @suburl)}<a href='#{@homeurl + record_link(record)}'>#{Util::relative_path record.shortpath, @path}</a></dt>
+ <dt class='result-file'>#{file_or_dirimg(true, @suburl)}<a href='#{@homeurl + record_link(record)}'>#{filename}</a></dt>
EOS
end
def record_link(record)
Mkurl.new(record.shortpath, @params).inherit_query_shead