From e2efe8e81dc7e9fce40b024df6a20bbf4b830350 Mon Sep 17 00:00:00 2001 From: drbrain Date: Tue, 28 Dec 2010 22:08:56 +0000 Subject: Import RDoc 3.1 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rdoc/markup/to_html.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib/rdoc/markup') 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 @@ -26,6 +26,11 @@ class RDoc::Markup::ToHtml < RDoc::Markup::Formatter attr_reader :in_list_entry # :nodoc: 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 @@ -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 -- cgit v1.2.3