aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/text_helper.rb
diff options
context:
space:
mode:
authorAlexey Vakhov <vakhov@gmail.com>2011-11-10 11:26:42 +0400
committerAlexey Vakhov <vakhov@gmail.com>2011-11-10 11:26:42 +0400
commitb5c3987294d3860a78b1b04ee49b2b55f3cdc614 (patch)
treebbac035f432d7eacbb37d222a08700e87664efbd /actionpack/lib/action_view/helpers/text_helper.rb
parenta625523e755421b0f96fe5b0a885462ef51582b1 (diff)
downloadrails-b5c3987294d3860a78b1b04ee49b2b55f3cdc614.tar.gz
rails-b5c3987294d3860a78b1b04ee49b2b55f3cdc614.tar.bz2
rails-b5c3987294d3860a78b1b04ee49b2b55f3cdc614.zip
Fix and simplify highlight regexp
Diffstat (limited to 'actionpack/lib/action_view/helpers/text_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/text_helper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/text_helper.rb b/actionpack/lib/action_view/helpers/text_helper.rb
index 21074efe86..bc8572fe69 100644
--- a/actionpack/lib/action_view/helpers/text_helper.rb
+++ b/actionpack/lib/action_view/helpers/text_helper.rb
@@ -120,7 +120,7 @@ module ActionView
text
else
match = Array(phrases).map { |p| Regexp.escape(p) }.join('|')
- text.gsub(/(#{match})(?!(?:[^<]*?)(?:["'])[^<>]*>)/i, options[:highlighter])
+ text.gsub(/(#{match})(?![^<]*?>)/i, options[:highlighter])
end.html_safe
end