diff options
author | Stan Lo <[email protected]> | 2024-12-31 20:17:04 +0800 |
---|---|---|
committer | git <[email protected]> | 2024-12-31 12:17:07 +0000 |
commit | c0e2623966ea72b2b7781a13dab47ad50c362c98 (patch) | |
tree | b2f750c824352be431f40b687f3e511d76f308e3 /lib/rdoc/markup | |
parent | 63b141ef21497b8694e9401c934fc41c3823e3ad (diff) |
[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.
https://github.com/ruby/rdoc/commit/ce77f51f63
Diffstat (limited to 'lib/rdoc/markup')
-rw-r--r-- | lib/rdoc/markup/to_html_crossref.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/rdoc/markup/to_html_crossref.rb b/lib/rdoc/markup/to_html_crossref.rb index e6661b621e..06fee91a11 100644 --- a/lib/rdoc/markup/to_html_crossref.rb +++ b/lib/rdoc/markup/to_html_crossref.rb @@ -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 |