summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authorHartley McGuire <[email protected]>2024-07-17 21:39:08 +0000
committerHiroshi SHIBATA <[email protected]>2024-07-18 09:40:01 +0900
commitd0c17cbd09e5455c203e8fd647e8967684562347 (patch)
tree5a54f3bfc72ce578fe1d57868b909fd59ec25e61 /file.c
parent239d54dfbce0f38cf4d31fa252b4d9bd65477bac (diff)
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.
Diffstat (limited to 'file.c')
0 files changed, 0 insertions, 0 deletions