ruby/lib/rdoc/markup
Hartley McGuire 5ac6194c2b [ruby/rdoc] Fix ToRdoc generating incorrect {label,name}-lists
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
2024-03-09 03:50:09 +00:00
..
attr_changer.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
attr_span.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
attribute_manager.rb [ruby/rdoc] [DOC] nodoc for probably internal methods 2023-12-16 00:26:39 +09:00
attributes.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
blank_line.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
block_quote.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
document.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
formatter.rb [ruby/rdoc] Fix TIDYLINK after braces 2023-11-14 07:59:56 +00:00
hard_break.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
heading.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
include.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
indented_paragraph.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
list.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
list_item.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
paragraph.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
parser.rb [ruby/rdoc] [DOC] nodoc for probably internal methods 2023-12-16 00:26:39 +09:00
pre_process.rb [ruby/rdoc] feat: add support for :category: on C functions 2021-10-16 01:39:36 +09:00
raw.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
regexp_handling.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
rule.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
table.rb [ruby/rdoc] [DOC] nodoc for probably internal methods 2023-12-16 00:26:39 +09:00
to_ansi.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
to_bs.rb [ruby/rdoc] Fix ToRdoc generating incorrect {label,name}-lists 2024-03-09 03:50:09 +00:00
to_html.rb [ruby/rdoc] [DOC] nodoc for probably internal methods 2023-12-16 00:26:39 +09:00
to_html_crossref.rb [ruby/rdoc] Allow empty name rdoc-ref as a local link 2023-12-31 15:19:50 +00:00
to_html_snippet.rb [ruby/rdoc] [DOC] Add missing documents 2023-12-16 00:26:37 +09:00
to_joined_paragraph.rb [ruby/rdoc] Use flat_map for better performance 2023-06-14 23:47:25 +00:00
to_label.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
to_markdown.rb [ruby/rdoc] Fix ToMarkdown missing newlines for label-lists 2024-03-08 10:13:04 +00:00
to_rdoc.rb [ruby/rdoc] Fix ToRdoc generating incorrect {label,name}-lists 2024-03-09 03:50:09 +00:00
to_table_of_contents.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
to_test.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
to_tt_only.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
verbatim.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00