mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-21 01:10:19 +00:00
Restructure markup & markdown to prepare for multiple markup language… (#2411)
* restructure markup & markdown to prepare for multiple markup languages support * adjust some functions between markdown and markup * fix tests * improve the comments
This commit is contained in:
parent
911ca02153
commit
52e11b24bf
19 changed files with 1206 additions and 1109 deletions
|
@ -9,6 +9,7 @@ import (
|
|||
|
||||
"code.gitea.io/gitea/modules/context"
|
||||
"code.gitea.io/gitea/modules/markdown"
|
||||
"code.gitea.io/gitea/modules/markup"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
)
|
||||
|
||||
|
@ -39,7 +40,7 @@ func Markdown(ctx *context.APIContext, form api.MarkdownOption) {
|
|||
switch form.Mode {
|
||||
case "gfm":
|
||||
md := []byte(form.Text)
|
||||
context := markdown.URLJoin(setting.AppURL, form.Context)
|
||||
context := markup.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