Repository navigation
fix: percent-encode wiki file links - #629
Merged
sng-asyncfunc merged 1 commit intoNov 10, 2026
Merged
Conversation
Spaces and parentheses end a Markdown link destination, so a path such as src/app/(marketing)/page.tsx or "docs/My Notes.md" never became a repository URL. Encode the branch and the path, and leave local paths unchanged. Signed-off-by: Ting Zhang <181050363+GPT-AGI@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
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.
post_process_wiki_contentinserted repository paths directly into Markdown destinations. For example, currentmainemits:[src/app/(marketing)/page.tsx:10](.../src/app/(marketing)/page.tsx#L10).CommonMark ends that destination at
), and a path such asdocs/My Notes.mdends at the first space. The same broken URLs appear in the Relevant source files block.Percent-encode branch and file path components for GitHub, GitLab, and Bitbucket. Slashes and existing
%HHescapes stay unchanged, local paths are untouched, and link labels remain readable.Verified on Python 3.12, Windows, from the clone:
The regression tests cover all three hosts, spaces, parentheses, existing escapes, and local paths.
ruff format --checkstill reports only three pre-existing long assertions in the test file.