diff options
author | Xavier Noria <fxn@hashref.com> | 2010-02-08 09:42:50 +0100 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2010-02-08 09:42:50 +0100 |
commit | 2928040e236cebc0c845211d074eadfbf019258c (patch) | |
tree | 9c9d1ff02ef7ad15c97a547299dca7e8ebcc68cd /railties/guides/rails_guides | |
parent | 6a6644742f81b1f7a8b8f35f43873bbf8827f1f1 (diff) | |
download | rails-2928040e236cebc0c845211d074eadfbf019258c.tar.gz rails-2928040e236cebc0c845211d074eadfbf019258c.tar.bz2 rails-2928040e236cebc0c845211d074eadfbf019258c.zip |
simplify a couple of regexps
Diffstat (limited to 'railties/guides/rails_guides')
-rw-r--r-- | railties/guides/rails_guides/textile_extensions.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/railties/guides/rails_guides/textile_extensions.rb b/railties/guides/rails_guides/textile_extensions.rb index 082c2efddd..affef1ccb0 100644 --- a/railties/guides/rails_guides/textile_extensions.rb +++ b/railties/guides/rails_guides/textile_extensions.rb @@ -1,7 +1,7 @@ module RailsGuides module TextileExtensions def notestuff(body) - body.gsub!(/^(IMPORTANT|CAUTION|WARNING|NOTE|INFO)(?:\.|\:)(.*)$/) do |m| + body.gsub!(/^(IMPORTANT|CAUTION|WARNING|NOTE|INFO)[.:](.*)$/) do |m| css_class = $1.downcase css_class = 'warning' if ['caution', 'important'].include?(css_class) @@ -13,7 +13,7 @@ module RailsGuides end def tip(body) - body.gsub!(/^TIP(?:\.|\:)(.*)$/) do |m| + body.gsub!(/^TIP[.:](.*)$/) do |m| result = "<div class='info'><p>" result << $1.strip result << '</p></div>' |