aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/CHANGELOG2
-rw-r--r--actionpack/lib/action_view/helpers/text_helper.rb7
2 files changed, 8 insertions, 1 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG
index 0c7db0ee2a..cdea029d44 100644
--- a/actionpack/CHANGELOG
+++ b/actionpack/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Forced newer versions of RedCloth to use hard breaks [DHH]
+
* Added new scriptaculous options for auto_complete_field #2343 [m.stienstra@fngtps.com]
* Don't prepend the asset host if the string is already a fully-qualified URL
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.