diff options
author | Jonas Franz <info@jonasfranz.software> | 2018-05-29 05:51:42 +0200 |
---|---|---|
committer | techknowlogick <techknowlogick@users.noreply.github.com> | 2018-05-28 23:51:42 -0400 |
commit | 2139c152cbf856b62e636df3b4dee784847b3a25 (patch) | |
tree | b9a73f39f9b8cd0f993b36e7d7bfa27b9ea4ac33 /modules/util/util_test.go | |
parent | f86f56e19c5ef1b19eb58d888cbab25cf4b28704 (diff) | |
download | gitea-2139c152cbf856b62e636df3b4dee784847b3a25.tar.gz gitea-2139c152cbf856b62e636df3b4dee784847b3a25.zip |
Fix relative markdown links with anchors (#4058)
* Replace '%28' with '#'
Add test case
Signed-off-by: Jonas Franz <info@jonasfranz.software>
* Use ResolveReference instead of strings.Replace
Signed-off-by: Jonas Franz <info@jonasfranz.software>
Diffstat (limited to 'modules/util/util_test.go')
-rw-r--r-- | modules/util/util_test.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/util/util_test.go b/modules/util/util_test.go index cc5875263a..67d9efe1d2 100644 --- a/modules/util/util_test.go +++ b/modules/util/util_test.go @@ -30,6 +30,8 @@ func TestURLJoin(t *testing.T) { "a", "b/c/"), newTest("a/b/d", "a/", "b/c/", "/../d/"), + newTest("https://try.gitea.io/a/b/c#d", + "https://try.gitea.io", "a/b", "c#d"), } { assert.Equal(t, test.Expected, URLJoin(test.Base, test.Elements...)) } |