Skip to content

[R2] Fix code block highlighting for Sippy commands - #33408

Open
SomSamantray wants to merge 1 commit into
cloudflare:productionfrom
SomSamantray:docs/r2-sippy-code-block-highlighting
Open

SomSamantray wants to merge 1 commit into
cloudflare:productionfrom
SomSamantray:docs/r2-sippy-code-block-highlighting

Conversation

@SomSamantray

Copy link
Copy Markdown
Contributor

Summary

Shiki's shell grammar reads < and > as redirections, so the <BUCKET_NAME> placeholder in the Sippy commands rendered with its last character in the default text colour — the artifact reported in #32496. Quoting the placeholder makes it a single shell string token, so the block highlights uniformly again.

The fix deliberately keeps the sh fence language and the angle-bracket placeholder form. The style guide requires a language on every fence, requires sh or bash for terminal commands, and requires angle-bracket placeholders in non-API contexts — switching to txt, dropping the language, or renaming the placeholder would break one of those three. A quoted placeholder is also copy-safe: pasting npx wrangler r2 bucket sippy enable "<BUCKET_NAME>" and replacing the placeholder works, and if the quotes are left in place the shell strips them.

Applied to the reported changelog entry and to the same command's enable and disable occurrences on the Sippy page, which carried the identical block. The JSON IAM policy on that page also contains <BUCKET_NAME>, but it is a JSON string literal inside a json fence, so its grammar handles it correctly and it is unchanged.

One thing this does not fix: the same mis-highlighting affects 423 other code blocks across 224 files, wherever a sh or bash fence contains an unquoted angle-bracket placeholder. That is a rendering-wide issue and the durable fix is a Shiki transformer or grammar override in astro.config.ts, which changes highlighting on every page and needs a maintainer's call. Raising it here rather than sweeping hundreds of files.

Fixes #32496

Documentation checklist

  • The change adheres to the documentation style guide.
  • If a larger change - such as adding a new page- an issue has been opened in relation to any incorrect or out of date information that this PR fixes.

@cloudflare-docs-bot

cloudflare-docs-bot Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Review

✅ No issues found in commit fd3c18e.

Code Review

This code review is in beta and may not always be helpful — use your judgment.

No code review issues found.

Conventions

No convention issues found.

Style Guide Review

No style-guide issues found.

Commands

Only codeowners can run commands. Post a comment with the command to trigger it.

Command Description
/review Runs a review now. Incremental if a prior review exists, full if not.
/full-review Re-reviews the entire PR diff from scratch, ignoring incremental history. Useful after a rebase, when you want a fresh review, or if the bot gets out of sync and reports issues that no longer exist.
/ignore-review-limit Permanently lifts the 2-review automatic limit for this PR. Future pushes will trigger reviews as normal.
/disable-auto-review Stops automatic reviews from triggering on future pushes to this PR. Codeowners can still run /review or /full-review manually.
/rebase Rebases the PR branch against production. On conflict, attempts to resolve automatically using AI. Stops with an explanation if confidence is not high enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:changelog product:r2 R2 object storage: https://developers.cloudflare.com/r2 size/xs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Characters at the end of a code block are unexpectedly of a different colour

5 participants