From c54a7328c41c7298393864de146fc2ad2698c354 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Sat, 23 Nov 2024 12:38:45 +0800 Subject: [PATCH] fine tune comments and tests --- models/renderhelper/repo_wiki.go | 3 ++- models/renderhelper/repo_wiki_test.go | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/models/renderhelper/repo_wiki.go b/models/renderhelper/repo_wiki.go index 8d82aa586149..aa456bf6ce2b 100644 --- a/models/renderhelper/repo_wiki.go +++ b/models/renderhelper/repo_wiki.go @@ -39,8 +39,9 @@ func (r *RepoWiki) ResolveLink(link string, likeType markup.LinkType) string { finalLink = r.ctx.ResolveLinkRelative(path.Join(r.repoLink, "wiki", r.opts.currentRefPath), r.opts.currentTreePath, link) case markup.LinkTypeMedia: finalLink = r.ctx.ResolveLinkRelative(path.Join(r.repoLink, "wiki/raw", r.opts.currentRefPath), r.opts.currentTreePath, link) - // wiki doesn't use src or raw + case markup.LinkTypeRaw: // wiki doesn't use it } + return finalLink } diff --git a/models/renderhelper/repo_wiki_test.go b/models/renderhelper/repo_wiki_test.go index 12729d602811..beab2570e7c0 100644 --- a/models/renderhelper/repo_wiki_test.go +++ b/models/renderhelper/repo_wiki_test.go @@ -50,4 +50,16 @@ func TestRepoWiki(t *testing.T) { ./image

`, rendered) }) + + t.Run("PathInTag", func(t *testing.T) { + rctx := NewRenderContextRepoWiki(context.Background(), repo1).WithMarkupType(markdown.MarkupName) + rendered, err := markup.RenderString(rctx, ` + +