1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

in guides generator, warn about duplicate header IDs only if WARN_DUPLICATE_HEADERS

This commit is contained in:
Xavier Noria 2009-03-22 00:43:56 +01:00
parent bf14453af9
commit dab7813ebc

View file

@ -146,7 +146,7 @@ module RailsGuides
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