diff --git a/guides/rails_guides/indexer.rb b/guides/rails_guides/indexer.rb index 1847f098814010ac4906646f3e9c58c0eb0a551c..89fbccbb1d359b64a4aa15fec757e485686c72b9 100644 --- a/guides/rails_guides/indexer.rb +++ b/guides/rails_guides/indexer.rb @@ -59,9 +59,8 @@ def process(string, current_level=3, counters=[1]) def title_to_idx(title) idx = title.strip.parameterize.sub(/^\d+/, '') - if idx.blank? - puts "BLANK ID: please put an explicit ID for section #{title}, as in h5(#my-id)" if warnings - idx = ("id-"+Digest::MD5.hexdigest(title.strip)).parameterize.sub(/^\d+/, '') + if warnings && idx.blank? + puts "BLANK ID: please put an explicit ID for section #{title}, as in h5(#my-id)" end idx end