mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-02 16:35:19 +02:00
Populate URL field of API commits (#3546)
* Populate URL field of API commits * fix orgmode_test
This commit is contained in:
parent
7b297808ce
commit
7b104f0cd0
11 changed files with 126 additions and 98 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue