diff options
Diffstat (limited to 'lib/rdoc/generators/html_generator.rb')
-rw-r--r-- | lib/rdoc/generators/html_generator.rb | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/rdoc/generators/html_generator.rb b/lib/rdoc/generators/html_generator.rb index be79226c8e..1f9b808e8d 100644 --- a/lib/rdoc/generators/html_generator.rb +++ b/lib/rdoc/generators/html_generator.rb @@ -114,7 +114,12 @@ module Generators lookup = name end - if /([A-Z].*)[.\#](.*)/ =~ lookup + # Find class, module, or method in class or module. + if /([A-Z]\w*)[.\#](\w+[!?=]?)/ =~ lookup + container = $1 + method = $2 + ref = @context.find_symbol(container, method) + elsif /([A-Za-z]\w*)[.\#](\w+(\([\.\w+\*\/\+\-\=\<\>]+\))?)/ =~ lookup container = $1 method = $2 ref = @context.find_symbol(container, method) @@ -206,12 +211,14 @@ module Generators unless defined? @markup @markup = SM::SimpleMarkup.new - # class names, variable names, file names, or instance variables + # class names, variable names, or instance variables @markup.add_special(/( - \b([A-Z]\w*(::\w+)*[.\#]\w+) # A::B.meth + \w+(::\w+)*[.\#]\w+(\([\.\w+\*\/\+\-\=\<\>]+\))? # A::B.meth(**) (for operator in Fortran95) + | \#\w+(\([.\w\*\/\+\-\=\<\>]+\))? # meth(**) (for operator in Fortran95) + | \b([A-Z]\w*(::\w+)*[.\#]\w+) # A::B.meth | \b([A-Z]\w+(::\w+)*) # A::B.. | \#\w+[!?=]? # #meth_name - | \b\w+([_\/\.]+\w+)+[!?=]? # meth_name + | \b\w+([_\/\.]+\w+)*[!?=]? # meth_name )/x, :CROSSREF) |