aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers
diff options
context:
space:
mode:
authorBrian Cardarella <bcardarella@gmail.com>2012-02-05 12:08:21 -0500
committerBrian Cardarella <bcardarella@gmail.com>2012-02-05 12:08:21 -0500
commite4915e1796db6e990a149e2ad760d393342449a8 (patch)
treedea67619dd85ede4e77c25768f8a2e8577fb2477 /actionpack/lib/action_view/helpers
parentd36cfe224455f169cb1ca905f2e7bf7daae3b8b5 (diff)
downloadrails-e4915e1796db6e990a149e2ad760d393342449a8.tar.gz
rails-e4915e1796db6e990a149e2ad760d393342449a8.tar.bz2
rails-e4915e1796db6e990a149e2ad760d393342449a8.zip
Highlight defaults to HTML5 `mark` element
Diffstat (limited to 'actionpack/lib/action_view/helpers')
-rw-r--r--actionpack/lib/action_view/helpers/text_helper.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/lib/action_view/helpers/text_helper.rb b/actionpack/lib/action_view/helpers/text_helper.rb
index ce79a3da48..3dc651501e 100644
--- a/actionpack/lib/action_view/helpers/text_helper.rb
+++ b/actionpack/lib/action_view/helpers/text_helper.rb
@@ -90,11 +90,11 @@ module ActionView
# Highlights one or more +phrases+ everywhere in +text+ by inserting it into
# a <tt>:highlighter</tt> string. The highlighter can be specialized by passing <tt>:highlighter</tt>
# as a single-quoted string with \1 where the phrase is to be inserted (defaults to
- # '<strong class="highlight">\1</strong>')
+ # '<mark>\1</mark>')
#
# ==== Examples
# highlight('You searched for: rails', 'rails')
- # # => You searched for: <strong class="highlight">rails</strong>
+ # # => You searched for: <mark>rails</mark>
#
# highlight('You searched for: ruby, rails, dhh', 'actionpack')
# # => You searched for: ruby, rails, dhh
@@ -111,9 +111,9 @@ module ActionView
def highlight(text, phrases, *args)
options = args.extract_options!
unless args.empty?
- options[:highlighter] = args[0] || '<strong class="highlight">\1</strong>'
+ options[:highlighter] = args[0] || '<mark>\1</mark>'
end
- options.reverse_merge!(:highlighter => '<strong class="highlight">\1</strong>')
+ options.reverse_merge!(:highlighter => '<mark>\1</mark>')
text = sanitize(text) unless options[:sanitize] == false
if text.blank? || phrases.blank?