Skip to content

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

@mrsdizzie

Description

@mrsdizzie

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions