Repository navigation
fix(tui): keep balanced parentheses in a markdown link's target - #7170
Merged
Hmbown merged 1 commit intoOct 31, 2026
Merged
Conversation
A `[text](url)` link ended at the first `)`, so a destination with parentheses of its own, like a Wikipedia article ending in `_(programming_language)` or an old Microsoft Learn page ending in `(v=vs.85)`, lost its last `)`. The hyperlink pointed at a page that doesn't exist and the `)` showed after the label. Bare URLs already keep balanced parentheses (bare_http_links_preserve_balanced_parentheses_in_target). End the destination at the first `)` without a matching `(`, using the has_unmatched_closing_delimiter check the bare URL path trims with. A destination whose parentheses don't balance is no longer a link, as in CommonMark, and shows as written. Signed-off-by: Lstarsky0 <59827030+Lstarsky0@users.noreply.github.com>
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. |
Hmbown
pushed a commit
that referenced
this pull request
Oct 31, 2026
Three @Lstarsky0 fixes merged as PRs (merges dc48701, 9986831, b2db2c0). #7171 carried its own changelog edit; #7169 and #7170 did not. They join the existing @Lstarsky0 Markdown and footer-status entries rather than adding new bullets, and the CONTRIBUTORS.md and Contributors section lines name all three. Verified before merging, on origin/main ecd256c with all three PRs merged together locally: cargo fmt --check clean; cargo test -p codewhale-tui-kit --lib 214 passed; cargo test -p codewhale-tui --lib (history:: markdown stream_chunk) 186 passed; dead-code, blocking-calls and locale-parity gates pass (run by hand, since CI's ratchet steps are advisory on fork PRs). No test or fixture asserted on the removed "Stream chunk timeout set to" status. After this edit: check-contributor-credit.py passes (11 contributors since v0.10.2, all three surfaces) and scripts/sync-changelog.sh reproduces crates/tui/CHANGELOG.md byte for byte. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: CodeWhale Bot <bot@codewhale.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
A
[text](url)link ends at the first), so a destination with parentheses of its own loses its last). The hyperlink then points at a page that doesn't exist, and the)shows after the label. Wikipedia articles with a qualifier and old Microsoft Learn pages ending in(v=vs.85)are common examples. This reply, at 100 columns:Before:
with these hyperlink targets:
After:
The bare URL on the second line was already right: bare URLs keep balanced parentheses (
bare_http_links_preserve_balanced_parentheses_in_target). A named link now ends at the first)without a matching(, using the samehas_unmatched_closing_delimitercheck the bare URL path trims with. So[y](https://example.com/f((x)))keeps both, and(see [docs](https://example.com/docs))and[z](https://example.com/z) (aside)link as before. A destination whose parentheses don't balance, like[x](https://example.com/a(b), is no longer a named link, as in CommonMark; it shows as written, with the bare URL inside it linked.Issue
No-Issue: a markdown link whose URL has parentheses loses its last
); I searched and found no issue for itHow I tested it
mainat c4f1e72 in a pseudo-terminal at 100x30 with an empty HOME and a local mock OpenAI-compatible server replying with the text above, and recorded the OSC 8 targets in the output (OSC 8 is on by default outside Windows); the rows and targets above come from those runs. A second reply checked the nested, prose and unbalanced cases in the paragraph above.cargo nextest run -p codewhale-tui -p codewhale-tui-kit --lib: 13628 of 13628 passed, with the 457 tests whose names matchmarkdown,link,url,osc8orinlineamong them.cargo fmt --all -- --check,cargo clippy -p codewhale-tui -p codewhale-tui-kitwith CI's flags (also on 1.99),cargo check -p codewhale-tui -p codewhale-tui-kit --all-targetsandcargo +1.89.0 check -p codewhale-tui -p codewhale-tui-kit: clean.Checklist
maincargo fmt --allpasses, and tests cover new or changed behavior —cargo fmtpasses; no new test, per AGENTS.md, so the runs above stand in for onedocs/features.toml(cargo test -p codewhale-tui --test feature_registrychecks it) — n/a