From 70462a011e4ab3e4d19e4bdd8c17da7631c1b4b5 Mon Sep 17 00:00:00 2001 From: dave Date: Mon, 12 Jul 2004 12:20:51 +0000 Subject: Allow multiple words in braces before a link git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ lib/rdoc/README | 3 ++- lib/rdoc/generators/html_generator.rb | 6 ++++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index ec638dacd4..4319048055 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-07-12 Dave Thomas + + * html_generator.rb: Support hyperlinks of the form {any text}[xxx] + as well as stuff[xxx] + Sat Jul 10 09:30:24 2004 NAKAMURA, Hiroshi * test/soap/marshal/test_struct.rb: use qualified build-tin class name diff --git a/lib/rdoc/README b/lib/rdoc/README index 6e234e31a5..e13ab87dc8 100644 --- a/lib/rdoc/README +++ b/lib/rdoc/README @@ -333,7 +333,8 @@ this margin are formatted verbatim. Hyperlinks can also be of the form label[url], in which case the label is used in the displayed text, and url is - used as the target. + used as the target. If label contains multiple words, + put it in braces: {multi word label}[url]. 9. Method parameter lists are extracted and displayed with the method description. If a method calls +yield+, then diff --git a/lib/rdoc/generators/html_generator.rb b/lib/rdoc/generators/html_generator.rb index 754deb9f77..38c5da5b04 100644 --- a/lib/rdoc/generators/html_generator.rb +++ b/lib/rdoc/generators/html_generator.rb @@ -177,7 +177,8 @@ module Generators def handle_special_TIDYLINK(special) text = special.text - unless text =~ /(\S+)\[(.*?)\]/ +# unless text =~ /(\S+)\[(.*?)\]/ + unless text =~ /\{(.*?)\}\[(.*?)\]/ or text =~ /(\S+)\[(.*?)\]/ return text end label = $1 @@ -218,7 +219,8 @@ module Generators @markup.add_special(/((link:|https?:|mailto:|ftp:|www\.)\S+\w)/, :HYPERLINK) # and links of the form [] - @markup.add_special(/\b(\S+?\[\S+?\.\S+?\])/, :TIDYLINK) + @markup.add_special(/(((\{.*?\})|\b\S+?)\[\S+?\.\S+?\])/, :TIDYLINK) +# @markup.add_special(/\b(\S+?\[\S+?\.\S+?\])/, :TIDYLINK) end unless defined? @html_formatter -- cgit v1.2.3