mirror of
https://github.com/ruby/ruby.git
synced 2025-08-28 07:26:00 +02:00
![]() Previously, any sort of "rich" markup for a definition list's label
would cause the Markdown parser to not recognize a definition list:
```ruby
md = <<~md
`one`
: This is a definition
md
doc = RDoc::Markdown.parse(md)
doc # => [doc: [para: "<code>one</code>\n: This is a definition"]]
```
This commit tweaks the grammar for Markdown definition lists so that
labels can include "rich" markup such as bold (`**`), code (```), etc:
```ruby
md = <<~md
`one`
: This is a definition
md
doc = RDoc::Markdown.parse(md)
doc # => [doc: [list: NOTE [item: ["<code>one</code>"]; [para: "This is a definition"]]]]
```
The [PHP Markdown Extra][1] Spec does not seem to specify whether or not
this should be allowed, but it is allowed in the RDoc format:
```ruby
rdoc = <<~rdoc
+code+::
This is a definition
rdoc
doc = RDoc::Markup.parse(rdoc)
doc # => [doc: [list: NOTE [item: ["+code+"]; [para: "This is a definition"]]]]
```
so accepting this change increases the parity of the two formats.
[1]: https://michelf.ca/projects/php-markdown/extra/#def-list
|
||
---|---|---|
.. | ||
MarkdownTest_1.0.3 | ||
support | ||
binary.dat | ||
helper.rb | ||
hidden.zip.txt | ||
README | ||
test.ja.largedoc | ||
test.ja.rdoc | ||
test.ja.txt | ||
test.txt | ||
test_rdoc_alias.rb | ||
test_rdoc_any_method.rb | ||
test_rdoc_attr.rb | ||
test_rdoc_class_module.rb | ||
test_rdoc_code_object.rb | ||
test_rdoc_comment.rb | ||
test_rdoc_constant.rb | ||
test_rdoc_context.rb | ||
test_rdoc_context_section.rb | ||
test_rdoc_cross_reference.rb | ||
test_rdoc_encoding.rb | ||
test_rdoc_extend.rb | ||
test_rdoc_generator_darkfish.rb | ||
test_rdoc_generator_json_index.rb | ||
test_rdoc_generator_markup.rb | ||
test_rdoc_generator_pot.rb | ||
test_rdoc_generator_pot_po.rb | ||
test_rdoc_generator_pot_po_entry.rb | ||
test_rdoc_generator_ri.rb | ||
test_rdoc_i18n_locale.rb | ||
test_rdoc_i18n_text.rb | ||
test_rdoc_include.rb | ||
test_rdoc_markdown.rb | ||
test_rdoc_markdown_test.rb | ||
test_rdoc_markup.rb | ||
test_rdoc_markup_attribute_manager.rb | ||
test_rdoc_markup_attributes.rb | ||
test_rdoc_markup_document.rb | ||
test_rdoc_markup_formatter.rb | ||
test_rdoc_markup_hard_break.rb | ||
test_rdoc_markup_heading.rb | ||
test_rdoc_markup_include.rb | ||
test_rdoc_markup_indented_paragraph.rb | ||
test_rdoc_markup_paragraph.rb | ||
test_rdoc_markup_parser.rb | ||
test_rdoc_markup_pre_process.rb | ||
test_rdoc_markup_raw.rb | ||
test_rdoc_markup_to_ansi.rb | ||
test_rdoc_markup_to_bs.rb | ||
test_rdoc_markup_to_html.rb | ||
test_rdoc_markup_to_html_crossref.rb | ||
test_rdoc_markup_to_html_snippet.rb | ||
test_rdoc_markup_to_joined_paragraph.rb | ||
test_rdoc_markup_to_label.rb | ||
test_rdoc_markup_to_markdown.rb | ||
test_rdoc_markup_to_rdoc.rb | ||
test_rdoc_markup_to_table_of_contents.rb | ||
test_rdoc_markup_to_tt_only.rb | ||
test_rdoc_markup_verbatim.rb | ||
test_rdoc_method_attr.rb | ||
test_rdoc_normal_class.rb | ||
test_rdoc_normal_module.rb | ||
test_rdoc_options.rb | ||
test_rdoc_parser.rb | ||
test_rdoc_parser_c.rb | ||
test_rdoc_parser_changelog.rb | ||
test_rdoc_parser_markdown.rb | ||
test_rdoc_parser_rd.rb | ||
test_rdoc_parser_ruby.rb | ||
test_rdoc_parser_simple.rb | ||
test_rdoc_rd.rb | ||
test_rdoc_rd_block_parser.rb | ||
test_rdoc_rd_inline.rb | ||
test_rdoc_rd_inline_parser.rb | ||
test_rdoc_rdoc.rb | ||
test_rdoc_require.rb | ||
test_rdoc_ri_driver.rb | ||
test_rdoc_ri_paths.rb | ||
test_rdoc_rubygems_hook.rb | ||
test_rdoc_servlet.rb | ||
test_rdoc_single_class.rb | ||
test_rdoc_stats.rb | ||
test_rdoc_store.rb | ||
test_rdoc_task.rb | ||
test_rdoc_text.rb | ||
test_rdoc_token_stream.rb | ||
test_rdoc_tom_doc.rb | ||
test_rdoc_top_level.rb | ||
xref_data.rb | ||
xref_test_case.rb |
you don't have to