diff --git a/lib/rdoc/markup/to_html_crossref.rb b/lib/rdoc/markup/to_html_crossref.rb
index 2911aee954..cc93021540 100644
--- a/lib/rdoc/markup/to_html_crossref.rb
+++ b/lib/rdoc/markup/to_html_crossref.rb
@@ -135,9 +135,6 @@ def link name, text
ref = @cross_reference.resolve name, text
- text = ref.output_name @context if
- RDoc::MethodAttr === ref and text == original_name
-
case ref
when String then
ref
diff --git a/test/test_rdoc_markup_to_html_crossref.rb b/test/test_rdoc_markup_to_html_crossref.rb
index 73b76de4d9..63fc95ff51 100644
--- a/test/test_rdoc_markup_to_html_crossref.rb
+++ b/test/test_rdoc_markup_to_html_crossref.rb
@@ -59,7 +59,7 @@ def test_convert_RDOCLINK_rdoc_ref
def test_convert_RDOCLINK_rdoc_ref_method
result = @to.convert 'rdoc-ref:C1#m'
- assert_equal para("#m"), result
+ assert_equal para("C1#m"), result
end
def test_convert_RDOCLINK_rdoc_ref_method_label
@@ -75,13 +75,13 @@ def test_convert_RDOCLINK_rdoc_ref_method_percent
result = @to.convert 'rdoc-ref:C1#%'
- assert_equal para("#%"), result
+ assert_equal para("C1#%"), result
m.singleton = true
result = @to.convert 'rdoc-ref:C1::%'
- assert_equal para("::%"), result
+ assert_equal para("C1::%"), result
end
def test_convert_RDOCLINK_rdoc_ref_method_percent_label
@@ -200,11 +200,16 @@ def test_to_html_CROSSREF_email_hyperlink_all
def test_link
assert_equal 'n', @to.link('n', 'n')
- assert_equal '::m', @to.link('m', 'm')
+ assert_equal 'm', @to.link('m', 'm')
+ end
+
+ def test_link_for_method_traverse
+ @to = RDoc::Markup::ToHtmlCrossref.new @options, 'C2.html', @c9
+ assert_equal 'C9::B#foo', @to.link('C9::B#foo', 'C9::B#foo')
end
def test_link_class_method_full
- assert_equal 'Parent.m',
+ assert_equal 'Parent::m',
@to.link('Parent::m', 'Parent::m')
end