diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-12-28 22:08:56 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-12-28 22:08:56 +0000 |
commit | e2efe8e81dc7e9fce40b024df6a20bbf4b830350 (patch) | |
tree | 942e66e071e759c7db670a42daeac26c7437f25b /lib/rdoc/markup/to_html.rb | |
parent | 90d5bcf9104fe58887cf705b718a9c7b537b51a5 (diff) | |
download | ruby-e2efe8e81dc7e9fce40b024df6a20bbf4b830350.tar.gz |
Import RDoc 3.1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/markup/to_html.rb')
-rw-r--r-- | lib/rdoc/markup/to_html.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/rdoc/markup/to_html.rb b/lib/rdoc/markup/to_html.rb index de723921e9..66f5c1986d 100644 --- a/lib/rdoc/markup/to_html.rb +++ b/lib/rdoc/markup/to_html.rb @@ -27,6 +27,11 @@ class RDoc::Markup::ToHtml < RDoc::Markup::Formatter attr_reader :list # :nodoc: ## + # Path to this document for relative links + + attr_accessor :from_path + + ## # Converts a target url to one that is relative to a given path def self.gen_relative_url(path, target) @@ -59,6 +64,7 @@ class RDoc::Markup::ToHtml < RDoc::Markup::Formatter @th = nil @in_list_entry = nil @list = nil + @from_path = '' # external hyperlinks @markup.add_special(/((link:|https?:|mailto:|ftp:|www\.)\S+\w)/, :HYPERLINK) @@ -79,8 +85,8 @@ class RDoc::Markup::ToHtml < RDoc::Markup::Formatter end ## - # Generate a hyperlink for url, labeled with text. Handle the - # special cases for img: and link: described under handle_special_HYPERLINK + # Generate a hyperlink for +url+, labeled with +text+. Handles the special + # cases for img: and link: described under handle_special_HYPERLINK def gen_url(url, text) if url =~ /([A-Za-z]+):(.*)/ then |