Repository navigation
fix: keep "=" in PR link query values and encode path spaces - #1840
Open
ManoharPaturi wants to merge 1 commit into
Open
ManoharPaturi wants to merge 1 commit into
ManoharPaturi wants to merge 1 commit into
Conversation
…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.
This branch has not been deployed
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.
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.