ruby/test/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
..
MarkdownTest_1.0.3 [ruby/rdoc] Fix some typos (https://github.com/ruby/rdoc/pull/1129) 2024-07-01 11:08:37 +09:00
support [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
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 [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
test_rdoc_attr.rb
test_rdoc_class_module.rb
test_rdoc_code_object.rb
test_rdoc_comment.rb [ruby/rdoc] Fix polynominal backtracking 2023-04-29 16:55:37 +00:00
test_rdoc_constant.rb
test_rdoc_context.rb [ruby/rdoc] Visibility should begin from public for each scope 2024-01-07 11:39:46 +00:00
test_rdoc_context_section.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
test_rdoc_cross_reference.rb
test_rdoc_encoding.rb
test_rdoc_extend.rb
test_rdoc_generator_darkfish.rb [ruby/rdoc] Fix references to nested label in table_of_contents 2023-05-02 04:19:46 +00:00
test_rdoc_generator_json_index.rb [ruby/rdoc] test/rdoc/test_rdoc_generator_json_index.rb: pend in test_generate in ppc64le. 2023-11-03 10:30:28 +00:00
test_rdoc_generator_markup.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
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 Require space between hash/content in ATX heading (#1140) 2024-07-18 09:40:01 +09:00
test_rdoc_markdown_test.rb [ruby/rdoc] Fix some typos (https://github.com/ruby/rdoc/pull/1129) 2024-07-01 11:08:37 +09:00
test_rdoc_markup.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
test_rdoc_markup_attribute_manager.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
test_rdoc_markup_attributes.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
test_rdoc_markup_document.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
test_rdoc_markup_formatter.rb [ruby/rdoc] Fix TIDYLINK after braces 2023-11-14 07:59:56 +00:00
test_rdoc_markup_hard_break.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
test_rdoc_markup_heading.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
test_rdoc_markup_include.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
test_rdoc_markup_indented_paragraph.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
test_rdoc_markup_paragraph.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
test_rdoc_markup_parser.rb [ruby/rdoc] Revert "Refactor RDoc::Markup::Parser#tokenize" 2022-11-27 19:46:12 +00:00
test_rdoc_markup_pre_process.rb
test_rdoc_markup_raw.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
test_rdoc_markup_to_ansi.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
test_rdoc_markup_to_bs.rb
test_rdoc_markup_to_html.rb [ruby/rdoc] Markup punctuations need to be separated with a space 2023-12-02 12:40:12 +00:00
test_rdoc_markup_to_html_crossref.rb [ruby/rdoc] Allow empty name rdoc-ref as a local link 2023-12-31 15:19:50 +00:00
test_rdoc_markup_to_html_snippet.rb
test_rdoc_markup_to_joined_paragraph.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
test_rdoc_markup_to_label.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
test_rdoc_markup_to_markdown.rb [ruby/rdoc] Fix ToMarkdown missing newlines for label-lists 2024-03-08 10:13:04 +00:00
test_rdoc_markup_to_rdoc.rb [ruby/rdoc] Fix ToRdoc generating incorrect {label,name}-lists 2024-03-09 03:50:09 +00:00
test_rdoc_markup_to_table_of_contents.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
test_rdoc_markup_to_tt_only.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
test_rdoc_markup_verbatim.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
test_rdoc_method_attr.rb
test_rdoc_normal_class.rb
test_rdoc_normal_module.rb
test_rdoc_options.rb [ruby/rdoc] Rename and move the tests for --locale option [ci skip] 2024-01-06 10:23:41 +00:00
test_rdoc_parser.rb [ruby/rdoc] Undo accidentally deleted lines 2024-01-11 08:39:52 +00:00
test_rdoc_parser_c.rb [ruby/rdoc] Fix support for rb_file_const and rb_curses_define_const 2023-12-25 21:12:49 +09:00
test_rdoc_parser_changelog.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
test_rdoc_parser_markdown.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
test_rdoc_parser_rd.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
test_rdoc_parser_ruby.rb [ruby/rdoc] Don't document aliases with trailing :nodoc directive 2024-02-09 01:07:17 +00:00
test_rdoc_parser_simple.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
test_rdoc_rd.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
test_rdoc_rd_block_parser.rb [ruby/rdoc] Non-RD part feature has not been imported to RDoc 2022-12-01 02:36:20 +09:00
test_rdoc_rd_inline.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
test_rdoc_rd_inline_parser.rb
test_rdoc_rdoc.rb [ruby/rdoc] Get rid of Kernel#open 2023-11-30 15:06:51 +00:00
test_rdoc_require.rb
test_rdoc_ri_driver.rb [ruby/rdoc] Fix fragile tests 2022-12-23 20:31:25 +09:00
test_rdoc_ri_paths.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
test_rdoc_rubygems_hook.rb
test_rdoc_servlet.rb
test_rdoc_single_class.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
test_rdoc_stats.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
test_rdoc_store.rb [ruby/rdoc] Use flat_map for better performance 2023-06-14 23:47:25 +00:00
test_rdoc_task.rb [ruby/rdoc] Add rdoc:coverage default task 2023-02-03 23:41:06 +00:00
test_rdoc_text.rb
test_rdoc_token_stream.rb [ruby/rdoc] test: Add tests for RDoc::TokenStream#add_tokens, add_token ,collect_tokens and pop_token 2024-03-15 00:10:14 +00:00
test_rdoc_tom_doc.rb
test_rdoc_top_level.rb
xref_data.rb [ruby/rdoc] Visibility should begin from public for each scope 2024-01-07 11:39:46 +00:00
xref_test_case.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00

you don't have to