Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

- Fix non-ascii characters in headers

Signed-off-by: Xavier Noria <fxn@hashref.com>
  • Loading branch information...
commit 60685475dce2582c445f77b4809865eab0299fd7 1 parent 3ecbae0
@apohllo apohllo authored fxn committed
Showing with 2 additions and 1 deletion.
  1. +2 −1  railties/guides/rails_guides/indexer.rb
View
3  railties/guides/rails_guides/indexer.rb
@@ -1,5 +1,6 @@
require 'active_support/core_ext/object/blank'
require 'active_support/ordered_hash'
+require 'active_support/core_ext/string/inflections'
module RailsGuides
class Indexer
@@ -58,7 +59,7 @@ def process(string, current_level=3, counters=[1])
end
def title_to_idx(title)
- idx = title.strip.downcase.gsub(/\s+|_/, '-').delete('^a-z0-9-').sub(/^[^a-z]*/, '')
+ idx = 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
Please sign in to comment.
Something went wrong with that request. Please try again.