Skip to content
Browse files

Allow generation of links to absolute paths, which seems like a broke…

…n idea but

does fix a unit test.
  • Loading branch information...
1 parent d7362c9 commit 122b8ba92d7682b9c96d8d65e233fa0bceaa28df designingpatts committed Sep 23, 2008
Showing with 3 additions and 2 deletions.
  1. +1 −1 lib/rdoc/markup/to_html_crossref.rb
  2. +2 −1 test/test_rdoc_markup_to_html_crossref.rb
View
2 lib/rdoc/markup/to_html_crossref.rb
@@ -65,7 +65,7 @@ class RDoc::Markup::ToHtmlCrossref < RDoc::Markup::ToHtml
# The key thing is that there must be at least
# one special character (period, slash, or
# underscore).
- | \w+[_\/\.][\w\/\.]+
+ | [\/\w]+[_\/\.][\w\/\.]+
# Things that have markup suppressed
| \\[^\s]
View
3 test/test_rdoc_markup_to_html_crossref.rb
@@ -127,7 +127,8 @@ def verify_method_crossref(xref, reference, class_name, method_seq)
# file_name (String) for String reference.
#
def verify_file_crossref(xref, reference, file_name)
- result = "<a href=\"../files/#{file_name.gsub(/\./, '_')}.html\">#{reference}</a>"
+ generated_document_path = Pathname.new("../files/#{file_name.gsub(/\./, '_')}.html").cleanpath.to_s
+ result = "<a href=\"#{generated_document_path}\">#{reference}</a>"
verify_convert xref, reference, result
end

0 comments on commit 122b8ba

Please sign in to comment.
Something went wrong with that request. Please try again.