Skip to content

Commit

Permalink
Docfix (closes #11230) [Henrik N]
Browse files Browse the repository at this point in the history
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9035 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
dhh committed Mar 15, 2008
1 parent 3ecde39 commit 1b41178
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions actionpack/lib/action_view/helpers/text_helper.rb
Expand Up @@ -292,18 +292,15 @@ def markdown(text)
# method does not remove the newlines from the +text+.
#
# ==== Examples
# my_text = """Here is some basic text...
# ...with a line break."""
# my_text = "Here is some basic text...\n...with a line break."
#
# simple_format(my_text)
# # => "<p>Here is some basic text...<br />...with a line break.</p>"
# # => "<p>Here is some basic text...\n<br />...with a line break.</p>"
#
# more_text = """We want to put a paragraph...
#
# ...right there."""
# more_text = "We want to put a paragraph...\n\n...right there."
#
# simple_format(more_text)
# # => "<p>We want to put a paragraph...</p><p>...right there.</p>"
# # => "<p>We want to put a paragraph...</p>\n\n<p>...right there.</p>"
def simple_format(text)
content_tag 'p', text.to_s.
gsub(/\r\n?/, "\n"). # \r\n and \r -> \n
Expand Down

0 comments on commit 1b41178

Please sign in to comment.