From b5c56090ee5f71134b85e3cdf7e3b89093649fac Mon Sep 17 00:00:00 2001 From: Ruy Diaz Date: Sat, 1 Apr 2017 21:35:20 -0700 Subject: Add anchor links to all headers To allow easy linking at all levels and not just from index --- guides/rails_guides/markdown.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'guides/rails_guides') diff --git a/guides/rails_guides/markdown.rb b/guides/rails_guides/markdown.rb index bf2cc82c7c..16aaa7d1eb 100644 --- a/guides/rails_guides/markdown.rb +++ b/guides/rails_guides/markdown.rb @@ -105,6 +105,10 @@ module RailsGuides node.inner_html = "#{node_index(hierarchy)} #{node.inner_html}" end end + + doc.css('h3, h4, h5, h6').each do |node| + node.inner_html = "#{node.inner_html}" + end end.to_html end end -- cgit v1.2.3