diff options
author | Richard Schneeman <richard.schneeman+no-recruiters@gmail.com> | 2018-07-28 21:58:36 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-28 21:58:36 -0500 |
commit | f10acfa7b64ac93cbbfc97e3a92d644960198764 (patch) | |
tree | 244ed8c81174abd2ae651f93781425f518688be9 /guides/rails_guides/markdown/renderer.rb | |
parent | 8741052ba25722283ea057f6f022f16b1931ce3e (diff) | |
parent | 27c6c071165342c770ed9c697024aa101dad4049 (diff) | |
download | rails-f10acfa7b64ac93cbbfc97e3a92d644960198764.tar.gz rails-f10acfa7b64ac93cbbfc97e3a92d644960198764.tar.bz2 rails-f10acfa7b64ac93cbbfc97e3a92d644960198764.zip |
Merge pull request #32695 from bdewater/enable-regex-cops
Enable regex cops
Diffstat (limited to 'guides/rails_guides/markdown/renderer.rb')
-rw-r--r-- | guides/rails_guides/markdown/renderer.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/guides/rails_guides/markdown/renderer.rb b/guides/rails_guides/markdown/renderer.rb index 78820a7856..8095b8c898 100644 --- a/guides/rails_guides/markdown/renderer.rb +++ b/guides/rails_guides/markdown/renderer.rb @@ -35,7 +35,7 @@ HTML def paragraph(text) if text =~ %r{^NOTE:\s+Defined\s+in\s+<code>(.*?)</code>\.?$} %(<div class="note"><p>Defined in <code><a href="#{github_file_url($1)}">#{$1}</a></code>.</p></div>) - elsif text =~ /^(TIP|IMPORTANT|CAUTION|WARNING|NOTE|INFO|TODO)[.:]/ + elsif /^(TIP|IMPORTANT|CAUTION|WARNING|NOTE|INFO|TODO)[.:]/.match?(text) convert_notes(text) elsif text.include?("DO NOT READ THIS FILE ON GITHUB") elsif text =~ /^\[<sup>(\d+)\]:<\/sup> (.+)$/ @@ -110,7 +110,7 @@ HTML end def api_link(url) - if url =~ %r{http://api\.rubyonrails\.org/v\d+\.} + if %r{http://api\.rubyonrails\.org/v\d+\.}.match?(url) url elsif edge url.sub("api", "edgeapi") |