fix(sections): keep fenced code blocks in a description intact - #709
Conversation
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
|
Warning Review limit reachedNext included review available in 49 minutes. View limit detailsLimit 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. Review configuration: ⚙️ Run configurationConfiguration used: Repository: bitflight-devops/github-action-readme-generator/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
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. Comment |
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 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".
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
There was a problem hiding this comment.
💡 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".
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
There was a problem hiding this comment.
💡 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".
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
There was a problem hiding this comment.
💡 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".
## [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))
|
🎉 This PR is included in version 2.0.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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
Related Issues
Changes Made
descriptionMarkdowninsrc/sections/update-description.tskeeps 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.scripts/verify-readme-contract.mjsbuilds its expected description with the same rule, in its own implementation.Testing
vp test,vp check)__tests__/update-description.test.tscovers prose, CRLF, a fenced block, fence closing rules, an unclosed fence, and inline backticks.action.yml, the built CLI writes a closed fence, the inputs section after it still generates, and the verifier passes.Additional Notes
The pre-commit
generate-docsrun made the same generated-file changes as #708: the v2.0.1 tag inREADME.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