Skip to content
Merged
Changes from 1 commit
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
Next Next commit
Links in markdown should be absolute to the repository not the server
Fix #15075

Signed-off-by: Andrew Thornton <[email protected]>
  • Loading branch information
zeripath committed Mar 21, 2021
commit 5117caca450c94bb1d1760f175d9e5720d88b510
3 changes: 3 additions & 0 deletions modules/markup/markdown/goldmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package markdown
import (
"bytes"
"fmt"
"path"
"regexp"
"strings"

Expand Down Expand Up @@ -99,6 +100,8 @@ func (g *ASTTransformer) Transform(node *ast.Document, reader text.Reader, pc pa
prefix = strings.Replace(prefix, "/src/", "/media/", 1)

lnk := string(link)
lnk = path.Clean("/" + lnk)[1:]

lnk = giteautil.URLJoin(prefix, lnk)
link = []byte(lnk)
}
Expand Down