summaryrefslogtreecommitdiff
path: root/lib/rdoc
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-04-14 16:13:36 +0900
committergit <svn-admin@ruby-lang.org>2022-04-14 16:37:14 +0900
commit5397dd2e76952c5afc0d838f1d0bd53bcb0c5258 (patch)
treeb4c71523552c8dd44c1905f2495f10010bf4008c /lib/rdoc
parent1a2490b5640606a69e6abac5c50869b6095f0239 (diff)
[ruby/rdoc] Apply matching word pairs to underscore-methods
Protected characters with `PROTECT_ATTR` should not have special roles. https://github.com/ruby/rdoc/commit/c318af0ea2
Diffstat (limited to 'lib/rdoc')
-rw-r--r--lib/rdoc/markup/attribute_manager.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/rdoc/markup/attribute_manager.rb b/lib/rdoc/markup/attribute_manager.rb
index 6843e6c3d0..6ef5af8856 100644
--- a/lib/rdoc/markup/attribute_manager.rb
+++ b/lib/rdoc/markup/attribute_manager.rb
@@ -150,9 +150,10 @@ class RDoc::Markup::AttributeManager
exclusive == exclusive?(bitmap)
}.keys
return if tags.empty?
- all_tags = @matching_word_pairs.keys
+ tags = "[#{tags.join("")}](?!#{PROTECT_ATTR})"
+ all_tags = "[#{@matching_word_pairs.keys.join("")}](?!#{PROTECT_ATTR})"
- re = /(^|\W|[#{all_tags.join("")}])([#{tags.join("")}])(\2*[#\\]?[\w:.\/\[\]-]+?\S?)\2(?!\2)([#{all_tags.join("")}]|\W|$)/
+ re = /(^|\W|#{all_tags})(#{tags})(\2*[#\\]?[\w:#{PROTECT_ATTR}.\/\[\]-]+?\S?)\2(?!\2)(#{all_tags}|\W|$)/
1 while str.gsub!(re) { |orig|
attr = @matching_word_pairs[$2]