From 810ebf7c6a2e9d02f76d8727e56c1706cc6ff66e Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 2 Oct 2005 20:21:43 +0000 Subject: Forced newer versions of RedCloth to use hard breaks [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2436 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_view/helpers/text_helper.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'actionpack/lib/action_view/helpers') diff --git a/actionpack/lib/action_view/helpers/text_helper.rb b/actionpack/lib/action_view/helpers/text_helper.rb index 2c718182fa..efb7922f76 100644 --- a/actionpack/lib/action_view/helpers/text_helper.rb +++ b/actionpack/lib/action_view/helpers/text_helper.rb @@ -82,7 +82,12 @@ module ActionView # Returns the text with all the Textile codes turned into HTML-tags. # This method is only available if RedCloth can be required. def textilize(text) - text.blank? ? "" : RedCloth.new(text, [ :hard_breaks ]).to_html + if text.blank? + "" + else + textilized = RedCloth.new(text, [ :hard_breaks ]) + textilized.hard_breaks = true if textilized.respond_to?("hard_breaks=") + textilized.to_html end # Returns the text with all the Textile codes turned into HTML-tags, but without the regular bounding

tag. -- cgit v1.2.3