From fbf643ca3d3f2171cf1a663816d6f2dfcfba60f7 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Tue, 12 Aug 2025 01:17:38 +0900 Subject: [PATCH 1/6] Escape unescaped backslash at the end of code Fix #1402 --- lib/rdoc/markdown.kpeg | 11 ++++++++++- test/rdoc/rdoc_markdown_test.rb | 28 ++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/lib/rdoc/markdown.kpeg b/lib/rdoc/markdown.kpeg index 174206ea74..5d428c9c80 100644 --- a/lib/rdoc/markdown.kpeg +++ b/lib/rdoc/markdown.kpeg @@ -497,6 +497,15 @@ end end + ## + # Wraps `text` in code markup for rdoc inline formatting + + def code text + # escape unescaped backslash at the end + backslash_at_end = "\\" if /(?#{text}#{backslash_at_end}" + end + ## # Parses inline markdown in table cells @@ -1129,7 +1138,7 @@ Code = ( Ticks1 @Sp < ( !( @Sp Ticks5 ) ( @Spacechar | @Newline !@BlankLine ) )+ > @Sp Ticks5 ) - { "#{text}" } + { code text } RawHtml = < (HtmlComment | HtmlBlockScript | HtmlTag) > { if html? then text else '' end } diff --git a/test/rdoc/rdoc_markdown_test.rb b/test/rdoc/rdoc_markdown_test.rb index d33eec47f3..bd030da994 100644 --- a/test/rdoc/rdoc_markdown_test.rb +++ b/test/rdoc/rdoc_markdown_test.rb @@ -158,6 +158,34 @@ def test_parse_code doc = parse "Code: ``` text`s ```" expected = doc(para("Code: text`s")) assert_equal expected, doc + + doc = parse "Code: `\\`" + expected = doc(para("Code: \\\\")) + assert_equal expected, doc + + doc = parse "Code: ` \\ `" + expected = doc(para("Code: \\\\")) + assert_equal expected, doc + + doc = parse "Code: `\\`s`" + expected = doc(para("Code: \\\\s`")) + assert_equal expected, doc + + doc = parse "Code: ``\\`s``" + expected = doc(para("Code: \\`s")) + assert_equal expected, doc + + doc = parse "Code: `` \\`s ``" + expected = doc(para("Code: \\`s")) + assert_equal expected, doc + + doc = parse "Code: ```\\`s```" + expected = doc(para("Code: \\`s")) + assert_equal expected, doc + + doc = parse "Code: ``` \\`s ```" + expected = doc(para("Code: \\`s")) + assert_equal expected, doc end def test_parse_code_github From 40563b2e5f216773085e5d8c43d61f650c1fc03f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Aug 2025 10:49:13 +0900 Subject: [PATCH 2/6] Bump actions/download-artifact from 4 to 5 (#1406) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 5.
Release notes

Sourced from actions/download-artifact's releases.

v5.0.0

What's Changed

v5.0.0

🚨 Breaking Change

This release fixes an inconsistency in path behavior for single artifact downloads by ID. If you're downloading single artifacts by ID, the output path may change.

What Changed

Previously, single artifact downloads behaved differently depending on how you specified the artifact:

  • By name: name: my-artifact → extracted to path/ (direct)
  • By ID: artifact-ids: 12345 → extracted to path/my-artifact/ (nested)

Now both methods are consistent:

  • By name: name: my-artifact → extracted to path/ (unchanged)
  • By ID: artifact-ids: 12345 → extracted to path/ (fixed - now direct)

Migration Guide

✅ No Action Needed If:
  • You download artifacts by name
  • You download multiple artifacts by ID
  • You already use merge-multiple: true as a workaround
⚠️ Action Required If:

You download single artifacts by ID and your workflows expect the nested directory structure.

Before v5 (nested structure):

- uses: actions/download-artifact@v4
  with:
    artifact-ids: 12345
    path: dist
# Files were in: dist/my-artifact/

Where my-artifact is the name of the artifact you previously uploaded

To maintain old behavior (if needed):

</tr></table>

... (truncated)

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/download-artifact&package-manager=github_actions&previous-version=4&new-version=5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/fork-preview-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fork-preview-deploy.yml b/.github/workflows/fork-preview-deploy.yml index 995f63abbd..a6a58b17ea 100644 --- a/.github/workflows/fork-preview-deploy.yml +++ b/.github/workflows/fork-preview-deploy.yml @@ -14,7 +14,7 @@ jobs: github.event.workflow_run.event == 'pull_request' steps: - name: Download PR information - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v5 with: name: pr github-token: ${{ secrets.GITHUB_TOKEN }} From 4861274e2152b3737be9a050c1ec0e6bb00d13bf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Aug 2025 10:49:58 +0900 Subject: [PATCH 3/6] Bump actions/checkout from 4 to 5 (#1407) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
Release notes

Sourced from actions/checkout's releases.

v5.0.0

What's Changed

⚠️ Minimum Compatible Runner Version

v2.327.1
Release Notes

Make sure your runner is updated to this version or newer to use this release.

Full Changelog: https://github.com/actions/checkout/compare/v4...v5.0.0

v4.3.0

What's Changed

New Contributors

Full Changelog: https://github.com/actions/checkout/compare/v4...v4.3.0

v4.2.2

What's Changed

Full Changelog: https://github.com/actions/checkout/compare/v4.2.1...v4.2.2

v4.2.1

What's Changed

New Contributors

Full Changelog: https://github.com/actions/checkout/compare/v4.2.0...v4.2.1

... (truncated)

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/checkout&package-manager=github_actions&previous-version=4&new-version=5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/cloudflare-preview.yml | 2 +- .github/workflows/gh-pages.yml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/push_gem.yml | 2 +- .github/workflows/ruby-core.yml | 4 ++-- .github/workflows/test.yml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cloudflare-preview.yml b/.github/workflows/cloudflare-preview.yml index f3917cc05c..c13476a259 100644 --- a/.github/workflows/cloudflare-preview.yml +++ b/.github/workflows/cloudflare-preview.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout PR Code - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: repository: ${{ github.event.client_payload.pr_checkout_repository }} ref: ${{ github.event.client_payload.pr_head_sha }} diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index d5d467cd46..3aed342352 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -20,7 +20,7 @@ jobs: if: ${{ github.repository == 'ruby/rdoc' && !startsWith(github.event_name, 'pull') }} steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Setup Ruby uses: ruby/setup-ruby@eaecf785f6a34567a6d97f686bbb7bccc1ac1e5c # v1.237.0 with: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 27ea686ca1..3a744e26f5 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -16,7 +16,7 @@ jobs: fail-fast: false runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 # v3.3.0 + - uses: actions/checkout@v5 # v3.3.0 # libyaml-dev is needed for psych, see https://github.com/ruby/setup-ruby/issues/409 - if: ${{ matrix.os == 'ubuntu-latest' }} run: sudo apt install libyaml-dev diff --git a/.github/workflows/push_gem.yml b/.github/workflows/push_gem.yml index 73d5173320..50fed5315b 100644 --- a/.github/workflows/push_gem.yml +++ b/.github/workflows/push_gem.yml @@ -27,7 +27,7 @@ jobs: with: egress-policy: audit - - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Set up Ruby uses: ruby/setup-ruby@eaecf785f6a34567a6d97f686bbb7bccc1ac1e5c # v1.237.0 diff --git a/.github/workflows/ruby-core.yml b/.github/workflows/ruby-core.yml index f243aa14ca..d0f2754111 100644 --- a/.github/workflows/ruby-core.yml +++ b/.github/workflows/ruby-core.yml @@ -28,7 +28,7 @@ jobs: bundler: none - name: Save latest buildable revision to environment run: echo "REF=$(ruby -v | cut -d')' -f1 | cut -d' ' -f5)" >> $GITHUB_ENV - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v3.1.0 + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v3.1.0 with: repository: ruby/ruby path: ruby/ruby @@ -51,7 +51,7 @@ jobs: autoconf ./configure -C --disable-install-doc working-directory: ruby/ruby - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v3.1.0 + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v3.1.0 with: path: ruby/rdoc - name: Build RDoc locally diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ce0b9aedef..ab26d8030b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -41,7 +41,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 # v3.3.0 + - uses: actions/checkout@v5 # v3.3.0 # libyaml-dev is needed for psych, see https://github.com/ruby/setup-ruby/issues/409 - if: ${{ matrix.os == 'ubuntu-latest' }} run: sudo apt install libyaml-dev From 85eeed26dfc250ae01c9ab7751a8178c6bd49483 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Tue, 12 Aug 2025 10:51:38 +0900 Subject: [PATCH 4/6] Revert "Shorten the description text to get rid of JRuby exception" (#1401) This reverts commit 0ed8f0179f38f9e0f01c55401b5045ed24b57f1b. No longer this workaround seems needed (jruby/jruby#8682). --- test/rdoc/rdoc_generator_darkfish_test.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/rdoc/rdoc_generator_darkfish_test.rb b/test/rdoc/rdoc_generator_darkfish_test.rb index 67715951ec..52ae0601d3 100644 --- a/test/rdoc/rdoc_generator_darkfish_test.rb +++ b/test/rdoc/rdoc_generator_darkfish_test.rb @@ -469,7 +469,8 @@ def test_meta_tags_for_markdown_files_paragraph top_level.comment = <<~MARKDOWN # Distributed Ruby: dRuby - dRuby is a distributed object system for Ruby. It allows an object. + dRuby is a distributed object system for Ruby. It allows an object in one + Ruby process to invoke methods on an object in another Ruby process. MARKDOWN @g.generate @@ -480,7 +481,7 @@ def test_meta_tags_for_markdown_files_paragraph " Date: Tue, 12 Aug 2025 01:27:48 +0900 Subject: [PATCH 5/6] Trim even spaces only in code Fix #1403 --- lib/rdoc/markdown.kpeg | 32 +++++++++++++++++--------------- test/rdoc/rdoc_markdown_test.rb | 30 +++++++++++++++++++++++++++--- 2 files changed, 44 insertions(+), 18 deletions(-) diff --git a/lib/rdoc/markdown.kpeg b/lib/rdoc/markdown.kpeg index 5d428c9c80..46c8f07f41 100644 --- a/lib/rdoc/markdown.kpeg +++ b/lib/rdoc/markdown.kpeg @@ -501,6 +501,8 @@ # Wraps `text` in code markup for rdoc inline formatting def code text + # trim even spaces + text = $2 while /\A( +|\t+)(.*)\1\z/ =~ text # escape unescaped backslash at the end backslash_at_end = "\\" if /(?#{text}#{backslash_at_end}" @@ -1113,30 +1115,30 @@ Ticks3 = "```" !"`" Ticks4 = "````" !"`" Ticks5 = "`````" !"`" -Code = ( Ticks1 @Sp < ( +Code = ( Ticks1 < ( ( !"`" Nonspacechar )+ | !Ticks1 /`+/ | - !( @Sp Ticks1 ) ( @Spacechar | @Newline !@BlankLine ) - )+ > @Sp Ticks1 | - Ticks2 @Sp < ( + !Ticks1 ( @Spacechar | @Newline !@BlankLine ) + )+ > Ticks1 | + Ticks2 < ( ( !"`" Nonspacechar )+ | !Ticks2 /`+/ | - !( @Sp Ticks2 ) ( @Spacechar | @Newline !@BlankLine ) - )+ > @Sp Ticks2 | - Ticks3 @Sp < ( + !Ticks2 ( @Spacechar | @Newline !@BlankLine ) + )+ > Ticks2 | + Ticks3 < ( ( !"`" Nonspacechar )+ | !Ticks3 /`+/ | - !( @Sp Ticks3 ) ( @Spacechar | @Newline !@BlankLine ) - )+ > @Sp Ticks3 | - Ticks4 @Sp < ( + !Ticks3 ( @Spacechar | @Newline !@BlankLine ) + )+ > Ticks3 | + Ticks4 < ( ( !"`" Nonspacechar )+ | !Ticks4 /`+/ | - !( @Sp Ticks4 ) ( @Spacechar | @Newline !@BlankLine ) - )+ > @Sp Ticks4 | - Ticks5 @Sp < ( + !Ticks4 ( @Spacechar | @Newline !@BlankLine ) + )+ > Ticks4 | + Ticks5 < ( ( !"`" Nonspacechar )+ | !Ticks5 /`+/ | - !( @Sp Ticks5 ) ( @Spacechar | @Newline !@BlankLine ) - )+ > @Sp Ticks5 + !Ticks5 ( @Spacechar | @Newline !@BlankLine ) + )+ > Ticks5 ) { code text } diff --git a/test/rdoc/rdoc_markdown_test.rb b/test/rdoc/rdoc_markdown_test.rb index bd030da994..26e5190b57 100644 --- a/test/rdoc/rdoc_markdown_test.rb +++ b/test/rdoc/rdoc_markdown_test.rb @@ -139,6 +139,14 @@ def test_parse_code expected = doc(para("Code: text")) assert_equal expected, doc + doc = parse "Code: ` text`" + expected = doc(para("Code: text")) + assert_equal expected, doc + + doc = parse "Code: `text `" + expected = doc(para("Code: text ")) + assert_equal expected, doc + doc = parse "Code: ` text `" expected = doc(para("Code: text")) assert_equal expected, doc @@ -147,6 +155,14 @@ def test_parse_code expected = doc(para("Code: text`s")) assert_equal expected, doc + doc = parse "Code: `` text`s``" + expected = doc(para("Code: text`s")) + assert_equal expected, doc + + doc = parse "Code: ``text`s ``" + expected = doc(para("Code: text`s ")) + assert_equal expected, doc + doc = parse "Code: `` text`s ``" expected = doc(para("Code: text`s")) assert_equal expected, doc @@ -155,6 +171,14 @@ def test_parse_code expected = doc(para("Code: text`s")) assert_equal expected, doc + doc = parse "Code: ``` text`s```" + expected = doc(para("Code: text`s")) + assert_equal expected, doc + + doc = parse "Code: ```text`s ```" + expected = doc(para("Code: text`s ")) + assert_equal expected, doc + doc = parse "Code: ``` text`s ```" expected = doc(para("Code: text`s")) assert_equal expected, doc @@ -223,7 +247,7 @@ def test_parse_code_github_format doc = <<-MD Example: -``` ruby +```ruby code goes here ``` MD @@ -1201,14 +1225,14 @@ def test_gfm_table_with_backslashes_in_code_spans body = [ ['Plain', '$\\\\', 'Should show backslash'], - ['Escaped', '$\\\\', 'Should show backslash'], + ['Escaped', '$\\\\ ', 'Should show backslash'], ['Multiple', '\\\\n\\\\t', 'Should show backslashes'], ] expected_table = @RM::Table.new(head, align, body) expected = doc( - para('Plain text: $\\\\ and $\\\\ should work.'), + para('Plain text: $\\\\ and $\\\\ should work.'), expected_table ) From f4a90c6010b2346cb5426d4496f5a37a136a82fb Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Tue, 12 Aug 2025 12:45:17 +0900 Subject: [PATCH 6/6] Tests for code enclosing a tab and a space --- test/rdoc/rdoc_markdown_test.rb | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/test/rdoc/rdoc_markdown_test.rb b/test/rdoc/rdoc_markdown_test.rb index 26e5190b57..19eeb1c9ef 100644 --- a/test/rdoc/rdoc_markdown_test.rb +++ b/test/rdoc/rdoc_markdown_test.rb @@ -151,6 +151,14 @@ def test_parse_code expected = doc(para("Code: text")) assert_equal expected, doc + doc = parse "Code: ` text\t`" + expected = doc(para("Code: text\t")) + assert_equal expected, doc + + doc = parse "Code: `\ttext `" + expected = doc(para("Code: \ttext ")) + assert_equal expected, doc + doc = parse "Code: ``text`s``" expected = doc(para("Code: text`s")) assert_equal expected, doc @@ -167,6 +175,14 @@ def test_parse_code expected = doc(para("Code: text`s")) assert_equal expected, doc + doc = parse "Code: `` text`s\t``" + expected = doc(para("Code: text`s\t")) + assert_equal expected, doc + + doc = parse "Code: ``\ttext`s ``" + expected = doc(para("Code: \ttext`s ")) + assert_equal expected, doc + doc = parse "Code: ```text`s```" expected = doc(para("Code: text`s")) assert_equal expected, doc @@ -183,6 +199,14 @@ def test_parse_code expected = doc(para("Code: text`s")) assert_equal expected, doc + doc = parse "Code: ``` text`s\t```" + expected = doc(para("Code: text`s\t")) + assert_equal expected, doc + + doc = parse "Code: ```\ttext`s ```" + expected = doc(para("Code: \ttext`s ")) + assert_equal expected, doc + doc = parse "Code: `\\`" expected = doc(para("Code: \\\\")) assert_equal expected, doc