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
2 changes: 1 addition & 1 deletion lib/rdoc/markup/to_label.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def initialize markup = nil
def convert text
label = convert_flow @am.flow text

CGI.escape label
CGI.escape(label).gsub('%', '-').sub(/^-/, '')
end

##
Expand Down
8 changes: 4 additions & 4 deletions test/test_rdoc_markup_heading.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ def setup
end

def test_aref
assert_equal 'label-Hello+Friend%21', @h.aref
assert_equal 'label-Hello+Friend-21', @h.aref
end

def test_label
assert_equal 'label-Hello+Friend%21', @h.label
assert_equal 'label-Hello+Friend%21', @h.label(nil)
assert_equal 'label-Hello+Friend-21', @h.label
assert_equal 'label-Hello+Friend-21', @h.label(nil)

context = RDoc::NormalClass.new 'Foo'

assert_equal 'class-Foo-label-Hello+Friend%21', @h.label(context)
assert_equal 'class-Foo-label-Hello+Friend-21', @h.label(context)
end

def test_plain_html
Expand Down
8 changes: 4 additions & 4 deletions test/test_rdoc_markup_to_label.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ def test_convert_crossref
assert_equal 'some_method', @to.convert('some_method')
assert_equal 'some_method', @to.convert('\\some_method')

assert_equal '%23some_method', @to.convert('#some_method')
assert_equal '%23some_method', @to.convert('\\#some_method')
assert_equal '23some_method', @to.convert('#some_method')
assert_equal '23some_method', @to.convert('\\#some_method')
end

def test_convert_em
Expand All @@ -92,11 +92,11 @@ def test_convert_em
end

def test_convert_em_dash # for HTML conversion
assert_equal '--', @to.convert('--')
assert_equal '-', @to.convert('--')
end

def test_convert_escape
assert_equal 'a+%3E+b', @to.convert('a > b')
assert_equal 'a+-3E+b', @to.convert('a > b')
end

def test_convert_tidylink
Expand Down