diff options
author | Michael Lavrisha <michael.lavrisha@gmail.com> | 2011-07-24 16:17:40 -0600 |
---|---|---|
committer | Michael Lavrisha <michael.lavrisha@gmail.com> | 2011-07-24 16:17:40 -0600 |
commit | e3dbe66e196069fde7d3ff118bd25a03184915fa (patch) | |
tree | 9a653a398e79604980aadcc53bdf7036f241a10f /railties/guides/rails_guides | |
parent | 4b189bd33695522058d3d58430d32d041560d4d8 (diff) | |
download | rails-e3dbe66e196069fde7d3ff118bd25a03184915fa.tar.gz rails-e3dbe66e196069fde7d3ff118bd25a03184915fa.tar.bz2 rails-e3dbe66e196069fde7d3ff118bd25a03184915fa.zip |
Update the TIP formatter to handle multiline tips
- includes 3 tests
Diffstat (limited to 'railties/guides/rails_guides')
-rw-r--r-- | railties/guides/rails_guides/textile_extensions.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/railties/guides/rails_guides/textile_extensions.rb b/railties/guides/rails_guides/textile_extensions.rb index 352c5e91dd..0887ebf76b 100644 --- a/railties/guides/rails_guides/textile_extensions.rb +++ b/railties/guides/rails_guides/textile_extensions.rb @@ -15,10 +15,11 @@ module RailsGuides end def tip(body) - body.gsub!(/^TIP[.:](.*)$/) do |m| + body.gsub!(/^TIP[.:](.*?)(\n\Z|\n\n+|\Z)/m) do |m| result = "<div class='info'><p>" result << $1.strip result << '</p></div>' + result << $2 if $2 result end end |