Skip to content

Commit

Permalink
Merge pull request rubocop#12994 from ksss/cops-doc-xref
Browse files Browse the repository at this point in the history
Fix anchor if it contains two or more slashes
  • Loading branch information
koic authored Jun 14, 2024
2 parents 5974179 + 7092e64 commit 452ad28
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rubocop/cops_documentation_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 452ad28

Please sign in to comment.