FIX: highlight in yellow, not blue

FEATURE: highlight in title
This commit is contained in:
Sam
2014-09-04 15:01:01 +10:00
parent ba4363d8fc
commit 0ade9bafff
7 changed files with 17 additions and 13 deletions

View File

@ -30,13 +30,7 @@ class Search
terms = @term.split(/\s+/)
blurb = TextHelper.excerpt(cooked, terms.first, radius: 100)
blurb = TextHelper.truncate(cooked, length: 200) if blurb.blank?
blurb = Sanitize.clean(blurb)
terms.each do |term|
blurb.gsub!(Regexp.new("(#{Regexp.escape(term)})", Regexp::IGNORECASE), "<span class='highlighted'>\\1</span>")
end
blurb
Sanitize.clean(blurb)
end
def add(object)