diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-10-02 20:21:43 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-10-02 20:21:43 +0000 |
commit | 810ebf7c6a2e9d02f76d8727e56c1706cc6ff66e (patch) | |
tree | 15257bf41a41717a8e91c13b3621af89c68bffa3 /actionpack/lib/action_view/helpers | |
parent | e19bd169fac08052e7f0ae4ae4e5ac368629d31f (diff) | |
download | rails-810ebf7c6a2e9d02f76d8727e56c1706cc6ff66e.tar.gz rails-810ebf7c6a2e9d02f76d8727e56c1706cc6ff66e.tar.bz2 rails-810ebf7c6a2e9d02f76d8727e56c1706cc6ff66e.zip |
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
Diffstat (limited to 'actionpack/lib/action_view/helpers')
-rw-r--r-- | actionpack/lib/action_view/helpers/text_helper.rb | 7 |
1 files changed, 6 insertions, 1 deletions
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. # <i>This method is only available if RedCloth can be required</i>. 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 <p> tag. |