summaryrefslogtreecommitdiff
path: root/lib/rdoc/markup
diff options
context:
space:
mode:
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