Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/markup/html.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ func visitNode(ctx *RenderContext, procs, textProcs []processor, node *html.Node
if ctx.IsWiki {
prefix = util.URLJoin(prefix, "wiki", "raw")
}
prefix = strings.Replace(prefix, "/src/", "/media/", 1)
prefix = strings.Replace(prefix, "/src/branch/", "/media/branch/", 1)

attr.Val = util.URLJoin(prefix, attr.Val)
}
Expand Down
2 changes: 1 addition & 1 deletion modules/markup/markdown/goldmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (g *ASTTransformer) Transform(node *ast.Document, reader text.Reader, pc pa
if pc.Get(isWikiKey).(bool) {
prefix = giteautil.URLJoin(prefix, "wiki", "raw")
}
prefix = strings.Replace(prefix, "/src/", "/media/", 1)
prefix = strings.Replace(prefix, "/src/branch/", "/media/branch/", 1)

lnk := strings.TrimLeft(string(link), "/")

Expand Down
2 changes: 1 addition & 1 deletion modules/markup/orgmode/orgmode.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func getMediaURL(l []byte) string {

// Check if link is valid
if len(srcURL) > 0 && !markup.IsLink(l) {
srcURL = strings.Replace(srcURL, "/src/", "/media/", 1)
srcURL = strings.Replace(srcURL, "/src/branch/", "/media/branch/", 1)
}

return srcURL
Expand Down