aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/text_helper.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2006-09-04 19:26:32 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2006-09-04 19:26:32 +0000
commitd4bb22b2201c1ece5dcbec7859e5e3039f9b2ec2 (patch)
tree1bfacd26b6dc3995c450b5f1b319a05c28a3830e /actionpack/lib/action_view/helpers/text_helper.rb
parenta693b3becad44f9e1e2fdacab26c1f367ad6ce71 (diff)
downloadrails-d4bb22b2201c1ece5dcbec7859e5e3039f9b2ec2.tar.gz
rails-d4bb22b2201c1ece5dcbec7859e5e3039f9b2ec2.tar.bz2
rails-d4bb22b2201c1ece5dcbec7859e5e3039f9b2ec2.zip
Fixed TextHelper#simple_format to deal with multiple single returns within a single paragraph (closes #5835) [moriq@moriq.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4994 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
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 91f368fa45..9d8921bf86 100644
--- a/actionpack/lib/action_view/helpers/text_helper.rb
+++ b/actionpack/lib/action_view/helpers/text_helper.rb
@@ -123,7 +123,7 @@ module ActionView
text.gsub!(/(\r\n|\n|\r)/, "\n") # lets make them newlines crossplatform
text.gsub!(/\n\n+/, "\n\n") # zap dupes
text.gsub!(/\n\n/, '</p>\0<p>') # turn two newlines into paragraph
- text.gsub!(/([^\n])(\n)([^\n])/, '\1\2<br />\3') # turn single newline into <br />
+ text.gsub!(/([^\n])(\n)(?=[^\n])/, '\1\2<br />') # turn single newline into <br />
content_tag("p", text)
end