[ruby/rdoc] Add autolink_excluded_words option to ignore

cross-references
(https://github.com/ruby/rdoc/pull/1259)

This config will be handy when the project name is the same as a class or
module name, which is often the case for most of the projects.

ce77f51f63
This commit is contained in:
Stan Lo 2024-12-31 20:17:04 +08:00 committed by git
parent 63b141ef21
commit c0e2623966
4 changed files with 38 additions and 2 deletions

View file

@ -83,6 +83,8 @@ class RDoc::Markup::ToHtmlCrossref < RDoc::Markup::ToHtml
def handle_regexp_CROSSREF(target)
name = target.text
return name if @options.autolink_excluded_words&.include?(name)
return name if name =~ /@[\w-]+\.[\w-]/ # labels that look like emails
unless @hyperlink_all then