Commit graph

21 commits

Author SHA1 Message Date
Stan Lo
03eb777c69 Sync RDoc 6.14.0 2025-05-22 15:04:47 -07:00
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
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
Nobuyoshi Nakada
cf3056be69 [ruby/rdoc] Add center align
512cc55a0e
2022-10-06 23:22:02 +09:00
Nobuyoshi Nakada
28e24ce355 [ruby/rdoc] Allow spaces around pipes
3b3a583580
2022-10-06 23:21:16 +09:00
Nobuyoshi Nakada
7c03c82444 [ruby/rdoc] Allow escaped pipes in cells
333952a62d
2022-10-06 23:17:49 +09:00
Nobuyoshi Nakada
f6c916c7ef [ruby/rdoc] Allow leading pipes to be ommitted
d263a2c9c4
2022-10-06 23:16:54 +09:00
Nobuyoshi Nakada
a19bf47d03 [ruby/rdoc] Allow trailing pipes to be ommitted
1318048877
2022-10-06 23:14:29 +09:00
Nobuyoshi Nakada
5beb75ce8d
[ruby/rdoc] Allow multiple footnotes without in-between blank lines
e4e054e3ce used four footnotes
without blank lines.  And the ChangeLog generated from that commit
resulted in ``undefined method `parts' for nil`` error.

For now, let a footnote terminated by the next footnote mark.

Also refined the error message when undefined footnote is used.

a7f290130b
2022-08-08 01:12:49 +09:00
Ulysse Buonomo
5348a34504 [ruby/rdoc] Relative loading for easier development (https://github.com/ruby/rdoc/pull/821)
This patch makes sure we only load relative code. Hence when coding or
testing rdoc, we'll be sure to always be using the correct code.

Discussion started at https://github.com/ruby/rdoc/pull/817.

Signed-off-by: Ulysse Buonomo <buonomo.ulysse@gmail.com>

aa41bd48eb

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2022-02-12 15:06:06 +09:00
Nobuyoshi Nakada
de8e6218a3 [ruby/rdoc] Fixed CodeFence without blank lines
Currently a fenced code block needs a preceding blank line, it
should not be required, as:
https://github.github.com/gfm/#fenced-code-blocks
> A fenced code block may interrupt a paragraph, and does not
> require a blank line either before or after.

Just recommended:
https://docs.github.com/en/github/writing-on-github/creating-and-highlighting-code-blocks
> We recommend placing a blank line before and after code blocks
> to make the raw formatting easier to read.

0e1776caf3
2021-03-16 15:47:27 +09:00
Nobuyoshi Nakada
3651f678a7 [ruby/rdoc] Support GFM table
9dc933df16
2021-03-16 15:47:27 +09:00
Nobuyoshi Nakada
cc8f55e9e3 [ruby/rdoc] HOME is preserved by RDoc::TestCase
6c4801d1f6
2020-04-25 02:49:37 +09:00
aycabta
a458317b91 Use assert_raise and skip for test/unit 2019-08-16 06:45:36 +09:00
Nobuyoshi Nakada
5555e3ef57 Renamed minitest_helper.rb as helper.rb 2019-08-16 06:07:11 +09:00
hsbt
98c7058bf7 Merge RDoc 6.0.3 from upstream.
It fixed the several bugs that was found after RDoc 6 releasing.

From: SHIBATA Hiroshi <hsbt@ruby-lang.org>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-26 05:56:26 +00:00
hsbt
5551871086 Merge rdoc-6.0.0.beta4 from upstream.
It version applied `frozen_string_literal: true`

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-27 10:45:24 +00:00
hsbt
db6c51ec4f Merge rdoc-6.0.0.beta3.
* It version introduced did you mean? feature for ri command:
    https://github.com/ruby/rdoc/pull/533
  * Removed obbsoleted ruby_token.rbb.
    [Bug #13990][ruby-core:83180]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-10 02:01:00 +00:00
naruse
3e92b635fb Add frozen_string_literal: false for all files
When you change this to true, you may need to add more tests.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16 05:07:31 +00:00
drbrain
df7dac9174 * lib/rdoc: Update to RDoc 4.1.0.preview.1
RDoc 4.1.0 contains a number of enhancements including a new default
  style and accessibility support.  You can see the changelog here:

  https://github.com/rdoc/rdoc/blob/v4.1.0.preview.1/History.rdoc

* test/rdoc:  ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-18 23:33:36 +00:00
drbrain
1c279a7d27 * lib/rdoc*: Updated to RDoc 4.0 (pre-release)
* bin/rdoc:  ditto
* test/rdoc:  ditto
* NEWS:  Updated with RDoc 4.0 information


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-27 04:28:14 +00:00