ruby/lib/rdoc
Hartley McGuire d0c17cbd09
Require space between hash/content in ATX heading (#1140)
While writing some Markdown documentation for Rails, I came across an
interesting case where trying to link to an instance method at the start
of a line would instead parse as an H1 heading:

```markdown
#response_body=
```

Expected:

```html
<a href=""><code>#response_body=</code></a>
```

Actual:

```html
<h1>response_body=</h1>
```

According to the CommonMark spec:

> At least one space or tab is required between the # characters and the
> heading’s contents, unless the heading is empty. Note that many
> implementations currently do not require the space. However, the space
> was required by the original ATX implementation, and it helps prevent
> things like the following from being parsed as headings:
>
> Example 64

So while some implementations do not follow this requirement, I believe
RDoc should because it makes it easy to write text similar to Example 64
(which was used in the new test) and it also enables automatically
linking to instance methods at the start of a line.
2024-07-18 09:40:01 +09:00
..
code_object [ruby/rdoc] Improve rubocop setup 2024-07-17 20:43:08 +00:00
generator [ruby/rdoc] Improve rubocop setup 2024-07-17 20:43:08 +00:00
i18n
markdown [ruby/rdoc] [DOC] Add missing documents 2023-12-16 00:26:37 +09:00
markup [ruby/rdoc] Improve rubocop setup 2024-07-17 20:43:08 +00:00
parser [ruby/rdoc] Improve rubocop setup 2024-07-17 20:43:08 +00:00
rd Update rdoc parsers generated by racc-1.7.3 2023-11-06 17:53:00 +09:00
ri [ruby/rdoc] Abort with error message if --dump argument invalid 2024-05-30 00:09:22 +00:00
stats [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
.document
code_object.rb
code_objects.rb
comment.rb [DOC] Link fixes 2023-10-03 16:31:34 +09:00
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
generator.rb
i18n.rb
known_classes.rb
markdown.rb Require space between hash/content in ATX heading (#1140) 2024-07-18 09:40:01 +09:00
markup.rb
options.rb [ruby/rdoc] Improve rubocop setup 2024-07-17 20:43:08 +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
ri.rb
rubygems_hook.rb
servlet.rb
stats.rb
store.rb [ruby/rdoc] Fix NoMethodError for start_with 2024-03-21 04:18:26 +00: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
version.rb [ruby/rdoc] Bump up 6.7.0 2024-05-23 01:17:32 +00:00