summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/misc
diff options
context:
space:
mode:
authorEthan Koenig <ethantkoenig@gmail.com>2018-02-20 04:50:42 -0800
committerBo-Yi Wu <appleboy.tw@gmail.com>2018-02-20 20:50:42 +0800
commit7b104f0cd03cf3df2b10f6f447857fe389654df1 (patch)
treecb8517fa34a6a7e18bc275f97f6541aa0783ba13 /routers/api/v1/misc
parent7b297808cee599f5ff58b9f6afa64d3ee980998e (diff)
downloadgitea-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 'routers/api/v1/misc')
-rw-r--r--routers/api/v1/misc/markdown.go4
-rw-r--r--routers/api/v1/misc/markdown_test.go8
2 files changed, 6 insertions, 6 deletions
diff --git a/routers/api/v1/misc/markdown.go b/routers/api/v1/misc/markdown.go
index ed50c1c05b..fd7d1489b3 100644
--- a/routers/api/v1/misc/markdown.go
+++ b/routers/api/v1/misc/markdown.go
@@ -8,9 +8,9 @@ import (
api "code.gitea.io/sdk/gitea"
"code.gitea.io/gitea/modules/context"
- "code.gitea.io/gitea/modules/markup"
"code.gitea.io/gitea/modules/markup/markdown"
"code.gitea.io/gitea/modules/setting"
+ "code.gitea.io/gitea/modules/util"
)
// Markdown render markdown document to HTML
@@ -45,7 +45,7 @@ func Markdown(ctx *context.APIContext, form api.MarkdownOption) {
switch form.Mode {
case "gfm":
md := []byte(form.Text)
- context := markup.URLJoin(setting.AppURL, form.Context)
+ context := util.URLJoin(setting.AppURL, form.Context)
if form.Wiki {
ctx.Write([]byte(markdown.RenderWiki(md, context, nil)))
} else {
diff --git a/routers/api/v1/misc/markdown_test.go b/routers/api/v1/misc/markdown_test.go
index 8c3051ea8e..c1449589a3 100644
--- a/routers/api/v1/misc/markdown_test.go
+++ b/routers/api/v1/misc/markdown_test.go
@@ -9,8 +9,8 @@ import (
"testing"
"code.gitea.io/gitea/modules/context"
- "code.gitea.io/gitea/modules/markup"
"code.gitea.io/gitea/modules/setting"
+ "code.gitea.io/gitea/modules/util"
api "code.gitea.io/sdk/gitea"
"github.com/go-macaron/inject"
@@ -53,7 +53,7 @@ func TestAPI_RenderGFM(t *testing.T) {
Context: Repo,
Wiki: true,
}
- requrl, _ := url.Parse(markup.URLJoin(AppURL, "api", "v1", "markdown"))
+ requrl, _ := url.Parse(util.URLJoin(AppURL, "api", "v1", "markdown"))
req := &http.Request{
Method: "POST",
URL: requrl,
@@ -147,7 +147,7 @@ func TestAPI_RenderSimple(t *testing.T) {
Text: "",
Context: Repo,
}
- requrl, _ := url.Parse(markup.URLJoin(AppURL, "api", "v1", "markdown"))
+ requrl, _ := url.Parse(util.URLJoin(AppURL, "api", "v1", "markdown"))
req := &http.Request{
Method: "POST",
URL: requrl,
@@ -166,7 +166,7 @@ func TestAPI_RenderSimple(t *testing.T) {
func TestAPI_RenderRaw(t *testing.T) {
setting.AppURL = AppURL
- requrl, _ := url.Parse(markup.URLJoin(AppURL, "api", "v1", "markdown"))
+ requrl, _ := url.Parse(util.URLJoin(AppURL, "api", "v1", "markdown"))
req := &http.Request{
Method: "POST",
URL: requrl,