diff --git a/lib/rubocop/cops_documentation_generator.rb b/lib/rubocop/cops_documentation_generator.rb index fb4c03921d25..81ecda6233c8 100644 --- a/lib/rubocop/cops_documentation_generator.rb +++ b/lib/rubocop/cops_documentation_generator.rb @@ -306,7 +306,7 @@ def table_of_content_for_department(department) filename = "#{department_to_basename(department)}.adoc" content = +"=== Department xref:#{filename}[#{type_title}]\n\n" cops_of_department(department).each do |cop| - anchor = cop.cop_name.sub('/', '').downcase + anchor = cop.cop_name.delete('/').downcase content << "* xref:#{filename}##{anchor}[#{cop.cop_name}]\n" end