mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
- Fix non-ascii characters in headers
Signed-off-by: Xavier Noria <fxn@hashref.com>
This commit is contained in:
committed by
Xavier Noria
parent
4b07bc8475
commit
ee7507b38e
@@ -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 @@ module RailsGuides
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user