diff --git a/actionview/lib/action_view/helpers/text_helper.rb b/actionview/lib/action_view/helpers/text_helper.rb index 6fe250d3c15518b46b60a59bea3043a89be98607..e3d4eb1d74b4de926cac263551e05cc3df5bd407 100644 --- a/actionview/lib/action_view/helpers/text_helper.rb +++ b/actionview/lib/action_view/helpers/text_helper.rb @@ -215,7 +215,7 @@ def pluralize(count, singular, plural = nil) def word_wrap(text, options = {}) line_width = options.fetch(:line_width, 80) - text.split("\n").collect do |line| + text.split("\n").collect! do |line| line.length > line_width ? line.gsub(/(.{1,#{line_width}})(\s+|$)/, "\\1\n").strip : line end * "\n" end @@ -264,7 +264,7 @@ def simple_format(text, html_options = {}, options = {}) if paragraphs.empty? content_tag(wrapper_tag, nil, html_options) else - paragraphs.map { |paragraph| + paragraphs.map! { |paragraph| content_tag(wrapper_tag, paragraph, html_options, options[:sanitize]) }.join("\n\n").html_safe end