diff options
author | Ethan Koenig <ethantkoenig@gmail.com> | 2018-02-20 04:50:42 -0800 |
---|---|---|
committer | Bo-Yi Wu <appleboy.tw@gmail.com> | 2018-02-20 20:50:42 +0800 |
commit | 7b104f0cd03cf3df2b10f6f447857fe389654df1 (patch) | |
tree | cb8517fa34a6a7e18bc275f97f6541aa0783ba13 /modules/markup/markdown/markdown.go | |
parent | 7b297808cee599f5ff58b9f6afa64d3ee980998e (diff) | |
download | gitea-7b104f0cd03cf3df2b10f6f447857fe389654df1.tar.gz gitea-7b104f0cd03cf3df2b10f6f447857fe389654df1.zip |
Populate URL field of API commits (#3546)
* Populate URL field of API commits
* fix orgmode_test
Diffstat (limited to 'modules/markup/markdown/markdown.go')
-rw-r--r-- | modules/markup/markdown/markdown.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/modules/markup/markdown/markdown.go b/modules/markup/markdown/markdown.go index f0ed0e03ab..2e3d180c4e 100644 --- a/modules/markup/markdown/markdown.go +++ b/modules/markup/markdown/markdown.go @@ -10,6 +10,7 @@ import ( "code.gitea.io/gitea/modules/markup" "code.gitea.io/gitea/modules/setting" + "code.gitea.io/gitea/modules/util" "github.com/russross/blackfriday" ) @@ -27,9 +28,9 @@ func (r *Renderer) Link(out *bytes.Buffer, link []byte, title []byte, content [] if link[0] != '#' { lnk := string(link) if r.IsWiki { - lnk = markup.URLJoin("wiki", lnk) + lnk = util.URLJoin("wiki", lnk) } - mLink := markup.URLJoin(r.URLPrefix, lnk) + mLink := util.URLJoin(r.URLPrefix, lnk) link = []byte(mLink) } } @@ -97,7 +98,7 @@ var ( func (r *Renderer) Image(out *bytes.Buffer, link []byte, title []byte, alt []byte) { prefix := r.URLPrefix if r.IsWiki { - prefix = markup.URLJoin(prefix, "wiki", "src") + prefix = util.URLJoin(prefix, "wiki", "src") } prefix = strings.Replace(prefix, "/src/", "/raw/", 1) if len(link) > 0 { @@ -110,7 +111,7 @@ func (r *Renderer) Image(out *bytes.Buffer, link []byte, title []byte, alt []byt } } else { lnk := string(link) - lnk = markup.URLJoin(prefix, lnk) + lnk = util.URLJoin(prefix, lnk) lnk = strings.Replace(lnk, " ", "+", -1) link = []byte(lnk) } |