Skip to content

fix: keep "=" in PR link query values and encode path spaces - #1840

Open
ManoharPaturi wants to merge 1 commit into
anthropics:mainfrom
ManoharPaturi:fix/pr-link-query-truncation
Open

ManoharPaturi wants to merge 1 commit into
anthropics:mainfrom
ManoharPaturi:fix/pr-link-query-truncation

Conversation

@ManoharPaturi

Copy link
Copy Markdown

Fixes #1839.

split each query pair on the FIRST "=" only (maxsplit 1) so values keep their equals signs, and encode path spaces whether or not a query string is present.

tests cover: title containing =, space in path with query, space in path without query, already-encoded urls pass through. all fail on main, pass here. full suite green, tsc clean.

…ropping path spaces

The 'Create a PR' link repair path split the URL on '?' and each query
pair on '=' with array destructuring, which keeps only the text before
the second delimiter: a title value like 'parse a=b' was silently cut to
'parse a', and a raw '?' in a value dropped everything after it. Spaces
in the URL path were also only encoded when no query string was present,
so the same model-written link with a query kept a raw space in the path
and broke the markdown link. A stray '%' in a value threw inside
decodeURIComponent and bailed to the fallback branch; it is now kept raw
so URLSearchParams percent-encodes it as %25.
Copilot AI lite review requested due to automatic review settings September 18, 2026 09:13

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch has not been deployed

No deployments
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.

ensureProperlyEncodedUrl truncates PR links at "=" in the title and leaves path spaces unencoded

2 participants