method
warn_about_broken_links
warn_about_broken_links(html)
public
Hide source
# File railties/guides/rails_guides/generator.rb, line 140 def warn_about_broken_links(html) # Textile generates headers with IDs computed from titles. anchors = Set.new(html.scan(/<h\d\s+id="([^"]+)/).flatten) # Also, footnotes are rendered as paragraphs this way. anchors += Set.new(html.scan(/<p\s+class="footnote"\s+id="([^"]+)/).flatten) # Check fragment identifiers. html.scan(/<a\s+href="#([^"]+)/).flatten.each do |fragment_identifier| next if fragment_identifier == 'mainCol' # in layout, jumps to some DIV unless anchors.member?(fragment_identifier) puts "BROKEN LINK: ##{fragment_identifier}" end end end


