summaryrefslogtreecommitdiff
path: root/lib/rdoc/markup
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-28 22:08:56 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-28 22:08:56 +0000
commite2efe8e81dc7e9fce40b024df6a20bbf4b830350 (patch)
tree942e66e071e759c7db670a42daeac26c7437f25b /lib/rdoc/markup
parent90d5bcf9104fe58887cf705b718a9c7b537b51a5 (diff)
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')
-rw-r--r--lib/rdoc/markup/to_html.rb10
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