@@ -29,15 +29,19 @@ class RDoc::Markup::ToHtmlCrossref < RDoc::Markup::ToHtml
2929 # references are removed unless +show_hash+ is true. Only method names
3030 # preceded by '#' or '::' are linked, unless +hyperlink_all+ is true.
3131
32- def initialize ( options , from_path , context , markup = nil )
32+ def initialize ( from_path , context , pipe : false , output_decoration : true ,
33+ hyperlink_all : false , show_hash : false ,
34+ autolink_excluded_words : [ ] , warn_missing_rdoc_ref : true )
3335 raise ArgumentError , 'from_path cannot be nil' if from_path . nil?
3436
35- super options , markup
37+ super ( pipe : pipe , output_decoration : output_decoration )
3638
3739 @context = context
3840 @from_path = from_path
39- @hyperlink_all = @options . hyperlink_all
40- @show_hash = @options . show_hash
41+ @hyperlink_all = hyperlink_all
42+ @show_hash = show_hash
43+ @autolink_excluded_words = autolink_excluded_words
44+ @warn_missing_rdoc_ref = warn_missing_rdoc_ref
4145
4246 @cross_reference = RDoc ::CrossReference . new @context
4347 end
@@ -48,7 +52,7 @@ def init_link_notation_regexp_handlings
4852
4953 # The crossref must be linked before tidylink because Klass.method[:sym]
5054 # will be processed as a tidylink first and will be broken.
51- crossref_re = @options . hyperlink_all ? ALL_CROSSREF_REGEXP : CROSSREF_REGEXP
55+ crossref_re = @hyperlink_all ? ALL_CROSSREF_REGEXP : CROSSREF_REGEXP
5256 @markup . add_regexp_handling crossref_re , :CROSSREF
5357 end
5458
@@ -83,7 +87,7 @@ def cross_reference(name, text = nil, code = true, rdoc_ref: false)
8387
8488 def handle_regexp_CROSSREF ( name )
8589 return convert_string ( name ) if in_tidylink_label?
86- return name if @options . autolink_excluded_words &.include? ( name )
90+ return name if @autolink_excluded_words &.include? ( name )
8791
8892 return name if name =~ /@[\w -]+\. [\w -]/ # labels that look like emails
8993
@@ -159,7 +163,7 @@ def link(name, text, code = true, rdoc_ref: false)
159163
160164 case ref
161165 when String then
162- if rdoc_ref && @options . warn_missing_rdoc_ref
166+ if rdoc_ref && @warn_missing_rdoc_ref
163167 puts "#{ @from_path } : `rdoc-ref:#{ name } ` can't be resolved for `#{ text } `"
164168 end
165169 ref
@@ -224,7 +228,7 @@ def apply_tidylink_label_special_handling(label, url)
224228 def tt_cross_reference ( code )
225229 return if in_tidylink_label?
226230
227- crossref_regexp = @options . hyperlink_all ? ALL_CROSSREF_REGEXP : CROSSREF_REGEXP
231+ crossref_regexp = @hyperlink_all ? ALL_CROSSREF_REGEXP : CROSSREF_REGEXP
228232 match = crossref_regexp . match ( code )
229233 return unless match && match . begin ( 1 ) . zero?
230234 return unless match . post_match . match? ( /\A [[:punct:]\s ]*\z / )
0 commit comments