From efc5a7171b79870d577c47b471c7438141131409 Mon Sep 17 00:00:00 2001 From: Lauris BH Date: Tue, 6 Mar 2018 10:43:50 +0200 Subject: [PATCH] Fix wiki inter-links with spaces (#3560) (#3632) --- modules/markup/html.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/markup/html.go b/modules/markup/html.go index d33afd384..f83f70f10 100644 --- a/modules/markup/html.go +++ b/modules/markup/html.go @@ -391,7 +391,11 @@ func RenderShortLinks(rawBytes []byte, urlPrefix string, noLink bool, isWikiMark } absoluteLink := isLink([]byte(link)) if !absoluteLink { - link = strings.Replace(link, " ", "+", -1) + if image { + link = strings.Replace(link, " ", "+", -1) + } else { + link = strings.Replace(link, " ", "-", -1) + } } if image { if !absoluteLink {