Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions lib/rdoc/markup/to_html_crossref.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 10 additions & 5 deletions test/test_rdoc_markup_to_html_crossref.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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("<a href=\"C1.html#method-i-m\">#m</a>"), result
assert_equal para("<a href=\"C1.html#method-i-m\">C1#m</a>"), result
end

def test_convert_RDOCLINK_rdoc_ref_method_label
Expand All @@ -75,13 +75,13 @@ def test_convert_RDOCLINK_rdoc_ref_method_percent

result = @to.convert 'rdoc-ref:C1#%'

assert_equal para("<a href=\"C1.html#method-i-25\">#%</a>"), result
assert_equal para("<a href=\"C1.html#method-i-25\">C1#%</a>"), result

m.singleton = true

result = @to.convert 'rdoc-ref:C1::%'

assert_equal para("<a href=\"C1.html#method-c-25\">::%</a>"), result
assert_equal para("<a href=\"C1.html#method-c-25\">C1::%</a>"), result
end

def test_convert_RDOCLINK_rdoc_ref_method_percent_label
Expand Down Expand Up @@ -200,11 +200,16 @@ def test_to_html_CROSSREF_email_hyperlink_all
def test_link
assert_equal 'n', @to.link('n', 'n')

assert_equal '<a href="C1.html#method-c-m">::m</a>', @to.link('m', 'm')
assert_equal '<a href="C1.html#method-c-m">m</a>', @to.link('m', 'm')
end

def test_link_for_method_traverse
@to = RDoc::Markup::ToHtmlCrossref.new @options, 'C2.html', @c9
assert_equal '<a href="C9/A.html#method-i-foo">C9::B#foo</a>', @to.link('C9::B#foo', 'C9::B#foo')
end

def test_link_class_method_full
assert_equal '<a href="Parent.html#method-c-m">Parent.m</a>',
assert_equal '<a href="Parent.html#method-c-m">Parent::m</a>',
@to.link('Parent::m', 'Parent::m')
end

Expand Down