зеркало из https://github.com/github/ruby.git
5ac6194c2b
Previously, trying to round-trip label-list and name-lists with the ToRdoc converter was not possible: ```ruby doc = <<~RDOC foo :: bar :: hi RDOC markup = RDoc::Markup.parse(doc) markup # => [doc: [list: NOTE [item: ["foo ", "bar"]; [para: "hi"]]]] rt = RDoc::Markup::ToRdoc.new.convert(markup) rt # => "foo\nbar:\n hi\n\n" rt_markup = RDoc::Markup.parse(rt) rt_markup # => [doc: [para: "foo ", "bar:"], [verb: "hi\n"]] ``` This commit addresses the issue by fixing ToRdoc to generate output that can be properly reparsed by RDoc. ToRdoc tests additionally needed to be updated for the new output. The old implementation of `accept_list_item_start` was copied to ToBs because those tests did not pass with the new changes and I am unfamiliar with the `backspace` format. After: ```ruby doc = <<~RDOC foo :: bar :: hi RDOC markup = RDoc::Markup.parse(doc) markup # => [doc: [list: NOTE [item: ["foo ", "bar"]; [para: "hi"]]]] rt = RDoc::Markup::ToRdoc.new.convert(markup) rt # => "foo::\nbar::\n hi\n\n" rt_markup = RDoc::Markup.parse(rt) rt_markup # => [doc: [list: NOTE [item: ["foo", "bar"]; [para: "hi"], blankline]]] ``` https://github.com/ruby/rdoc/commit/c6c51aa900 |
||
---|---|---|
.. | ||
attr_changer.rb | ||
attr_span.rb | ||
attribute_manager.rb | ||
attributes.rb | ||
blank_line.rb | ||
block_quote.rb | ||
document.rb | ||
formatter.rb | ||
hard_break.rb | ||
heading.rb | ||
include.rb | ||
indented_paragraph.rb | ||
list.rb | ||
list_item.rb | ||
paragraph.rb | ||
parser.rb | ||
pre_process.rb | ||
raw.rb | ||
regexp_handling.rb | ||
rule.rb | ||
table.rb | ||
to_ansi.rb | ||
to_bs.rb | ||
to_html.rb | ||
to_html_crossref.rb | ||
to_html_snippet.rb | ||
to_joined_paragraph.rb | ||
to_label.rb | ||
to_markdown.rb | ||
to_rdoc.rb | ||
to_table_of_contents.rb | ||
to_test.rb | ||
to_tt_only.rb | ||
verbatim.rb |