From d4bb22b2201c1ece5dcbec7859e5e3039f9b2ec2 Mon Sep 17 00:00:00 2001
From: David Heinemeier Hansson
Date: Mon, 4 Sep 2006 19:26:32 +0000
Subject: 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
---
actionpack/lib/action_view/helpers/text_helper.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'actionpack/lib/action_view')
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/, '
\0') # turn two newlines into paragraph
- text.gsub!(/([^\n])(\n)([^\n])/, '\1\2
\3') # turn single newline into
+ text.gsub!(/([^\n])(\n)(?=[^\n])/, '\1\2
') # turn single newline into
content_tag("p", text)
end
--
cgit v1.2.3