Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ruby/rdoc] Allow rich definition list labels for Markdown
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 ruby/rdoc@8f943bbba4
- Loading branch information