ruby/lib/rdoc
Hartley McGuire 08961ce8e3 [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

8f943bbba4
2024-03-11 20:00:51 +09:00
..
context [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
generator [ruby/rdoc] [DOC] nodoc for probably internal methods 2023-12-16 00:26:39 +09:00
i18n
markdown [ruby/rdoc] [DOC] Add missing documents 2023-12-16 00:26:37 +09:00
markup [ruby/rdoc] Fix ToRdoc generating incorrect {label,name}-lists 2024-03-09 03:50:09 +00:00
parser [ruby/rdoc] Don't document aliases with trailing :nodoc directive 2024-02-09 01:07:17 +00:00
rd Update rdoc parsers generated by racc-1.7.3 2023-11-06 17:53:00 +09:00
ri [ruby/rdoc] Delay DidYouMean until NotFoundError#message is called 2023-10-17 11:07:57 +00:00
stats [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
.document
alias.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
anon_class.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
any_method.rb [ruby/rdoc] Omit descriptions and parameter lists for methods defined in C not mentioned in call-seq 2023-09-05 00:45:42 +00:00
attr.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
class_module.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
code_object.rb
code_objects.rb
comment.rb [DOC] Link fixes 2023-10-03 16:31:34 +09:00
constant.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
context.rb
cross_reference.rb [ruby/rdoc] [DOC] Add missing documents 2023-12-16 00:26:37 +09:00
encoding.rb [ruby/rdoc] Remove unused method RDoc::Encoding.remove_frozen_string_literal 2023-12-16 00:25:51 +09:00
erb_partial.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
erbio.rb [ruby/rdoc] Remove code for versions older than Ruby 2.6 2023-09-05 01:14:52 +00:00
extend.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
generator.rb
ghost_method.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
i18n.rb
include.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
known_classes.rb [ruby/rdoc] Fix the known classes more 2022-07-11 13:43:14 +09:00
markdown.rb [ruby/rdoc] Allow rich definition list labels for Markdown 2024-03-11 20:00:51 +09:00
markup.rb [ruby/rdoc] [DOC] Removes remaining old Markup Reference (https://github.com/ruby/rdoc/pull/910) 2022-08-07 21:07:23 +09:00
meta_method.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
method_attr.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
mixin.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
normal_class.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
normal_module.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
options.rb [ruby/rdoc] Ignore locale at write_options 2024-01-06 10:17:49 +00:00
parser.rb [ruby/rdoc] Respect modeline to detect parser 2024-01-11 06:55:39 +00:00
rd.rb
rdoc.gemspec [ruby/rdoc] Add source_code, homepage and changelog uris to gemspec metadata [ci skip] 2023-07-05 04:08:17 +00:00
rdoc.rb [ruby/rdoc] Isolate root dir if specified 2023-05-06 07:39:24 +00:00
require.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
ri.rb
rubygems_hook.rb
servlet.rb
single_class.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
stats.rb
store.rb [ruby/rdoc] [DOC] Add missing documents 2023-12-16 00:26:37 +09:00
task.rb [ruby/rdoc] Actually execute RDoc document task for coverage 2023-02-06 23:09:05 +00:00
text.rb [ruby/rdoc] [DOC] Add missing documents 2023-12-16 00:26:37 +09:00
token_stream.rb [ruby/rdoc] Early return when token_stream is nil 2023-12-05 06:21:52 +00:00
tom_doc.rb
top_level.rb [ruby/rdoc] [DOC] Add missing documents 2023-12-16 00:26:37 +09:00
version.rb [ruby/rdoc] Bump up v6.6.2 2023-12-16 11:42:30 +08:00