From 7092e64ac740422c61477a6f8c1658f002369951 Mon Sep 17 00:00:00 2001 From: ksss Date: Fri, 14 Jun 2024 16:17:46 +0900 Subject: [PATCH] Fix anchor if it contains two or more slashes --- lib/rubocop/cops_documentation_generator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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