Skip to content

fix: bold or code before a link no longer breaks the line - #233

Merged
brtkwr merged 1 commit into
mainfrom
fix/bold-link-render
Nov 4, 2026
Merged

brtkwr merged 1 commit into
mainfrom
fix/bold-link-render

Conversation

@brtkwr

@brtkwr brtkwr commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

What changes for you

Messages with bold or code near a link now read correctly in the preview.

Message text Before Now
**[the PR #5](url)** is approved 1m[the PR #5 underlined, with the stray 1m[ showing the PR #5 as a link
**Approved** see [x](url) 1mApproved see [x all one link Approved in bold, then x as the link
`code` and [x](url) 36mcode and [x all one link code coloured, then x as the link

The same text feeds the Ctrl+O link list, so its entries are right too.

Why

Bold and code colours are added before links are found, so links never end up with colour codes inside their address. But those colour codes contain a [, and the link pattern started matching there. The [ is now hidden from the pattern until links are done.

Proof

  • Rendered in the real TUI from a transcript with these lines, using the built binary, an empty HOME and a private tmux socket: no stray text, and the link text is right.
  • New test on the exact visible text of ten mixes of bold, code and links, and that no broken escape is left. The previous test checked only the address, so it passed with this bug.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QUnP8k6tg8jgSku3uPCCjL

A link could start at the [ inside ccs's own bold or code colouring, so a
bold link showed a stray 1m[, and any bold or code earlier on a line became
part of the next link's text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QUnP8k6tg8jgSku3uPCCjL
@brtkwr
brtkwr enabled auto-merge November 4, 2026 14:55
@brtkwr
brtkwr merged commit 7584ff1 into main Nov 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant