Skip to content

fix(changelog): keep line breaks in code blocks - #59762

Merged
Hona merged 1 commit into
devfrom
fix/changelog-code-blocks
Oct 27, 2026
Merged

Hona merged 1 commit into
devfrom
fix/changelog-code-blocks

Conversation

@opencode-agent

Copy link
Copy Markdown
Contributor

Fenced code blocks on /changelog rendered on a single line. The main code rule sets white-space: nowrap for inline code, and it also applied to <pre><code>, so the lines in the v2.2.0 diff block were joined and the line widened the page.

This change adds two rules:

  • main pre code { white-space: pre; } keeps the line breaks.
  • main pre { overflow-x: auto; margin: 0 0 12px; } scrolls long lines inside the block instead of the page and matches paragraph spacing.

No syntax highlighting is added.

Verification: I rendered the current CHANGELOG.md through the worker's handle() at 1280px and 390px in dark mode. The diff block shows four lines, and the <pre> scroll width equals its client width at both sizes. bun test and bun typecheck pass in services/changelog.

Requested by: @Hona (Hona via Slack)

@Hona
Hona enabled auto-merge (squash) October 27, 2026 23:00

@opencodejr opencodejr 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.

The fix looks correct. The new main pre code { white-space: pre; } rule is more specific than main code { white-space: nowrap; }, so code blocks keep their line breaks and inline code still doesn't wrap. overflow-x: auto keeps long lines scrolling inside the block, and the 12px bottom margin matches .markdown p.

I rendered the current CHANGELOG.md through handle() and confirmed the diff block comes out as <pre><code> with its newlines and the new rules are in the page CSS. I couldn't check the page in a browser here; there is no browser in my sandbox. bun test passes and tsc --noEmit passes.

The public API is unchanged; only the changelog page's CSS changes.

I have no concerns.

@Hona
Hona merged commit 45b53fe into dev Oct 27, 2026
14 checks passed
@Hona
Hona deleted the fix/changelog-code-blocks branch October 27, 2026 23:02
alsuren pushed a commit to alsuren/opencode that referenced this pull request Oct 28, 2026
Co-authored-by: Hona <10430890+Hona@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant