Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion modules/markup/markdown/goldmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ func (g *GiteaASTTransformer) Transform(node *ast.Document, reader text.Reader,

lnk := string(link)
lnk = giteautil.URLJoin(prefix, lnk)
lnk = strings.Replace(lnk, " ", "+", -1)
link = []byte(lnk)
}
v.Destination = link
Expand Down
1 change: 0 additions & 1 deletion modules/markup/markup.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ func RenderWiki(filename string, rawBytes []byte, urlPrefix string, metas map[st
}

func render(parser Parser, rawBytes []byte, urlPrefix string, metas map[string]string, isWiki bool) []byte {
urlPrefix = strings.Replace(urlPrefix, " ", "+", -1)
result := parser.Render(rawBytes, urlPrefix, metas, isWiki)
// TODO: one day the error should be returned.
result, err := PostProcess(result, urlPrefix, metas, isWiki)
Expand Down
3 changes: 3 additions & 0 deletions modules/util/url.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ func PathEscapeSegments(path string) string {

// URLJoin joins url components, like path.Join, but preserving contents
func URLJoin(base string, elems ...string) string {
// We do need to escape special chars here or else they can be silently discarded
// in the ResolveReference call below
base = PathEscapeSegments(base)
if !strings.HasSuffix(base, "/") {
base += "/"
}
Expand Down