diff --git a/lib/rdoc/markup/to_markdown.rb b/lib/rdoc/markup/to_markdown.rb index 5dd60e18f5..b915fab60b 100644 --- a/lib/rdoc/markup/to_markdown.rb +++ b/lib/rdoc/markup/to_markdown.rb @@ -45,8 +45,6 @@ def handle_regexp_HARD_BREAK target # Finishes consumption of `list` def accept_list_end list - @res << "\n" - super end @@ -60,6 +58,8 @@ def accept_list_item_end list_item when :NOTE, :LABEL then use_prefix + @res << "\n" + 4 else @list_index[-1] = @list_index.last.succ @@ -81,11 +81,11 @@ def accept_list_item_start list_item attributes(label).strip end.join "\n" - bullets << "\n:" + bullets << "\n" unless bullets.empty? @prefix = ' ' * @indent @indent += 4 - @prefix << bullets + (' ' * (@indent - 1)) + @prefix << bullets << ":" << (' ' * (@indent - 1)) else bullet = type == :BULLET ? '*' : @list_index.last.to_s + '.' @prefix = (' ' * @indent) + bullet.ljust(4) diff --git a/test/rdoc/test_rdoc_markup_to_markdown.rb b/test/rdoc/test_rdoc_markup_to_markdown.rb index ff47364faa..92ed37bc50 100644 --- a/test/rdoc/test_rdoc_markup_to_markdown.rb +++ b/test/rdoc/test_rdoc_markup_to_markdown.rb @@ -69,7 +69,7 @@ def accept_list_item_end_bullet end def accept_list_item_end_label - assert_equal "cat\n: ", @to.res.join + assert_equal "cat\n: \n", @to.res.join assert_equal 0, @to.indent, 'indent' end @@ -79,7 +79,7 @@ def accept_list_item_end_lalpha end def accept_list_item_end_note - assert_equal "cat\n: ", @to.res.join + assert_equal "cat\n: \n", @to.res.join assert_equal 0, @to.indent, 'indent' end @@ -319,9 +319,7 @@ def list_nested expected = <<-EXPECTED * l1 * l1.1 - * l2 - EXPECTED assert_equal expected, @to.end_accepting @@ -343,7 +341,6 @@ def list_verbatim * second - EXPECTED assert_equal expected, @to.end_accepting