Refactor markup render system (#32589)
This PR mainly moves some code and introduces `RenderContext.WithXxx` functions
This commit is contained in:
parent
81ac8d914c
commit
c4e27cb27b
49 changed files with 486 additions and 626 deletions
|
@ -143,15 +143,15 @@ func (r *Writer) resolveLink(kind, link string) string {
|
|||
kind = org.RegularLink{URL: link}.Kind()
|
||||
}
|
||||
|
||||
base := r.Ctx.Links.Base
|
||||
base := r.Ctx.RenderOptions.Links.Base
|
||||
if r.Ctx.IsMarkupContentWiki() {
|
||||
base = r.Ctx.Links.WikiLink()
|
||||
} else if r.Ctx.Links.HasBranchInfo() {
|
||||
base = r.Ctx.Links.SrcLink()
|
||||
base = r.Ctx.RenderOptions.Links.WikiLink()
|
||||
} else if r.Ctx.RenderOptions.Links.HasBranchInfo() {
|
||||
base = r.Ctx.RenderOptions.Links.SrcLink()
|
||||
}
|
||||
|
||||
if kind == "image" || kind == "video" {
|
||||
base = r.Ctx.Links.ResolveMediaLink(r.Ctx.IsMarkupContentWiki())
|
||||
base = r.Ctx.RenderOptions.Links.ResolveMediaLink(r.Ctx.IsMarkupContentWiki())
|
||||
}
|
||||
|
||||
link = util.URLJoin(base, link)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue