Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

in guides generator, warn about duplicate header IDs only if WARN_DUP…

…LICATE_HEADERS
  • Loading branch information...
commit dab7813ebc6c9624d20a95ab7e78066d5f5238fd 1 parent bf14453
@fxn fxn authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  railties/guides/rails_guides/generator.rb
View
2  railties/guides/rails_guides/generator.rb
@@ -146,7 +146,7 @@ def extract_anchors(html)
anchors = Set.new
html.scan(/<h\d\s+id="([^"]+)/).flatten.each do |anchor|
if anchors.member?(anchor)
- puts "*** DUPLICATE HEADER ID: #{anchor}, please consider rewording"
+ puts "*** DUPLICATE HEADER ID: #{anchor}, please consider rewording" if ENV.key?("WARN_DUPLICATE_HEADERS")
else
anchors << anchor
end
Please sign in to comment.
Something went wrong with that request. Please try again.