method
split_paragraphs
v6.1.7.7 -
Show latest stable
- Class:
ActionView::Helpers::TextHelper
split_paragraphs(text)private
No documentation available.
# File actionview/lib/action_view/helpers/text_helper.rb, line 456
def split_paragraphs(text)
return [] if text.blank?
text.to_str.gsub(/\r\n?/, "\n").split(/\n\n+/).map! do |t|
t.gsub!(/([^\n]\n)(?=[^\n])/, '\1<br />') || t
end
end