diff options
author | Henare Degan <henare.degan@gmail.com> | 2013-02-15 17:40:04 +1100 |
---|---|---|
committer | Henare Degan <henare.degan@gmail.com> | 2013-02-15 17:59:06 +1100 |
commit | a0f250204a376ce97a187cf8a9b2cb0b8c628298 (patch) | |
tree | 812504a7b8da2431b3fed6f38f6796cdbbc84e00 /app/helpers/application_helper.rb | |
parent | 8f1caab7990dc417e32b14cbb5f00c34a0ddc10c (diff) | |
parent | d16f2f8242352a2d3c0350275110453dd6ac6b12 (diff) |
Merge branch 'develop' into rails-3-spike
Conflicts:
Gemfile
Gemfile.lock
app/controllers/general_controller.rb
app/controllers/track_controller.rb
app/models/outgoing_message.rb
app/models/public_body.rb
app/models/user.rb
app/views/general/frontpage.rhtml
config/environment.rb
config/initializers/inflections.rb
config/initializers/mime_types.rb
db/migrate/094_remove_old_tags_foreign_key.rb
lib/timezone_fixes.rb
spec/models/request_mailer_spec.rb
spec/views/request/list.rhtml_spec.rb
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r-- | app/helpers/application_helper.rb | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index b9ba712a4..42f9d30f1 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -54,15 +54,12 @@ module ApplicationHelper # Highlight words, also escapes HTML (other than spans that we add) def highlight_words(t, words, html = true) if html - t = h(t) - end - if html - t = highlight(t, words, '<span class="highlight">\1</span>') + highlight(h(t), words, '<span class="highlight">\1</span>').html_safe else - t = highlight(t, words, '*\1*') + highlight(t, words, '*\1*') end - return t end + def highlight_and_excerpt(t, words, excount, html = true) newt = excerpt(t, words[0], excount) if not newt |