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:
parent
bf14453af9
commit
dab7813ebc
1 changed files with 1 additions and 1 deletions
|
@ -146,7 +146,7 @@ module RailsGuides
|
||||||
anchors = Set.new
|
anchors = Set.new
|
||||||
html.scan(/<h\d\s+id="([^"]+)/).flatten.each do |anchor|
|
html.scan(/<h\d\s+id="([^"]+)/).flatten.each do |anchor|
|
||||||
if anchors.member?(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
|
else
|
||||||
anchors << anchor
|
anchors << anchor
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue