Better logic for handling of filenames with # in them when generating links in markdown #4866

Closed
opened 2025-11-02 06:05:22 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @mrsdizzie on GitHub (Feb 16, 2020).

Right now there are a few bugs trying to turn relative links with a # in them into valid links using our various parsers. This is a combination of assuming anything that starts with a # is an anchor in goldmark.go and not escaping the filename in util.URLJoin.

Some test cases to fix for reference:

https://try.gitea.io/mrsdizzie/testcase/src/branch/master/%231readme.md
https://try.gitea.io/mrsdizzie/testcase/src/branch/master/my%231readme.md

Originally created by @mrsdizzie on GitHub (Feb 16, 2020). Right now there are a few bugs trying to turn relative links with a ```#``` in them into valid links using our various parsers. This is a combination of assuming anything that starts with a # is an anchor in goldmark.go and not escaping the filename in util.URLJoin. Some test cases to fix for reference: https://try.gitea.io/mrsdizzie/testcase/src/branch/master/%231readme.md https://try.gitea.io/mrsdizzie/testcase/src/branch/master/my%231readme.md
GiteaMirror added the type/enhancementissue/stale labels 2025-11-02 06:05:22 -06:00
Author
Owner

@stale[bot] commented on GitHub (Apr 17, 2020):

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

@stale[bot] commented on GitHub (Apr 17, 2020): This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.
Author
Owner

@stale[bot] commented on GitHub (May 1, 2020):

This issue has been automatically closed because of inactivity. You can re-open it if needed.

@stale[bot] commented on GitHub (May 1, 2020): This issue has been automatically closed because of inactivity. You can re-open it if needed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#4866