Skip to content

fix(sections): keep fenced code blocks in a description intact - #709

Merged
Jamie-BitFlight merged 4 commits into
mainfrom
claude/description-fences
Sep 29, 2026
Merged

Jamie-BitFlight merged 4 commits into
mainfrom
claude/description-fences

Conversation

@Jamie-BitFlight

Copy link
Copy Markdown
Contributor

Description

The description updater turned every blank line into <br />, including the blank line before a fenced code block. The opening fence then sat mid-line as text. The closing fence opened a new fence that nothing closed, so GitHub rendered the rest of the README as code (#705).

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Related Issues

Changes Made

  • descriptionMarkdown in src/sections/update-description.ts keeps a fenced code block verbatim, on lines of its own. It applies the space squashing and the <br /> conversion only to the prose around the block.
  • A description with no fence converts exactly as before, so no existing README changes.
  • scripts/verify-readme-contract.mjs builds its expected description with the same rule, in its own implementation.

Testing

  • All existing tests pass (vp test, vp check)
  • Added new tests for new functionality: __tests__/update-description.test.ts covers prose, CRLF, a fenced block, fence closing rules, an unclosed fence, and inline backticks.
  • Manually tested the changes:
    • The source and verifier implementations agree on every case above.
    • With a fenced description in action.yml, the built CLI writes a closed fence, the inputs section after it still generates, and the verifier passes.
    • This repo's README and both integration targets give unchanged output.

Additional Notes

The pre-commit generate-docs run made the same generated-file changes as #708: the v2.0.1 tag in README.md, and reordered SVG attributes. The two PRs make identical changes to these files, so either can merge first.

🤖 Generated with Claude Code

https://claude.ai/code/session_01H37LVnd9qB6PmZ5bJi5H2t


Generated by Claude Code

The description updater turned every blank line into <br />, including
the one before a fenced code block. The opening fence then sat mid-line
as text, and the closing fence opened a fence that nothing closed, so
GitHub rendered the rest of the README as code.

descriptionMarkdown keeps a fenced block verbatim on lines of its own and
applies the squashing and <br /> conversion to the prose around it. A
description with no fence converts exactly as before. The contract
verifier builds its expected description with the same rule.

Fixes #705

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H37LVnd9qB6PmZ5bJi5H2t
@coderabbitai

coderabbitai Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 49 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: bitflight-devops/github-action-readme-generator/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 361eb916-c30f-4c5f-9775-549a0749971e

📥 Commits

Reviewing files that changed from the base of the PR and between d0435a8 and b2a61c6.

⛔ Files ignored due to path filters (1)
  • .github/ghadocs/branding.svg is excluded by !**/*.svg
📒 Files selected for processing (4)
  • README.md
  • __tests__/update-description.test.ts
  • scripts/verify-readme-contract.mjs
  • src/sections/update-description.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 92.03% 994 / 1080
🔵 Statements 92.18% 1014 / 1100
🔵 Functions 94.96% 151 / 159
🔵 Branches 86.66% 533 / 615
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/sections/update-description.ts 100% 94.44% 100% 100%
Generated in workflow #1043 for commit b2a61c6 by the Vitest Coverage Report Action

@Jamie-BitFlight
Jamie-BitFlight marked this pull request as ready for review September 26, 2026 23:14
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-29T10:48:18.397248Z b2a61c6 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fe87da0fc4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/sections/update-description.ts Outdated
A backtick fence's info string cannot hold a backtick, so a description
line such as ```code``` is prose opens an inline code span, not a fence.
It was read as an unclosed fence, which left the rest of the description
unconverted. The description updater and the contract verifier both
reject such an opener now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H37LVnd9qB6PmZ5bJi5H2t

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 13fa01d9a9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/sections/update-description.ts Outdated
Comment thread src/sections/update-description.ts Outdated
A line-based fence scan only saw fences with up to three spaces of
indentation, so a fence inside a list item took the prose path. Fenced
code blocks are now found with the markdown parser prettier already
bundles, in the description updater and in the contract verifier.
Indented code blocks stay on the prose path, as before.

The comments now state the rule and link #705 instead of describing the
old failure.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H37LVnd9qB6PmZ5bJi5H2t

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7ca78eb755

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/sections/update-description.ts Outdated
The fence check trimmed a code node's leading whitespace, so an indented
code block whose first line starts with backticks was kept verbatim as a
fence. A fenced block's node starts at its fence and an indented block's
node starts at its indentation, so the check now reads the untrimmed
start, in the description updater and in the contract verifier.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H37LVnd9qB6PmZ5bJi5H2t

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b2a61c6a62

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/sections/update-description.ts
Comment thread src/sections/update-description.ts
@Jamie-BitFlight
Jamie-BitFlight merged commit 47728d4 into main Sep 29, 2026
11 checks passed
@Jamie-BitFlight
Jamie-BitFlight deleted the claude/description-fences branch September 29, 2026 11:00
Jamie-BitFlight pushed a commit that referenced this pull request Sep 29, 2026
## [2.0.3](v2.0.2...v2.0.3) (2026-09-29)

### Bug Fixes

* **markers:** never pair a marker with an example in closed code ([#712](#712)) ([44f4da7](44f4da7))
* **readme-generator:** warn about mistyped and missing section markers ([#708](#708)) ([7d6c536](7d6c536))
* **sections:** keep fenced code blocks in a description intact ([#709](#709)) ([47728d4](47728d4))
@Jamie-BitFlight

Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in version 2.0.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@Jamie-BitFlight Jamie-BitFlight added the released This issue/pull request has been released. label Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released This issue/pull request has been released.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A fenced code block in an action description is written as an unclosed fence

2 participants