summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2018-03-06 10:43:50 +0200
committerBo-Yi Wu <appleboy.tw@gmail.com>2018-03-06 16:43:50 +0800
commitefc5a7171b79870d577c47b471c7438141131409 (patch)
treeb30238a9e8ac1d0cf18a01b77415861c91a7c8fe
parent93f34fd8a2d6b3d32a6fc117249196aafb425981 (diff)
downloadgitea-efc5a7171b79870d577c47b471c7438141131409.tar.gz
gitea-efc5a7171b79870d577c47b471c7438141131409.zip
Fix wiki inter-links with spaces (#3560) (#3632)
-rw-r--r--modules/markup/html.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/markup/html.go b/modules/markup/html.go
index d33afd3841..f83f70f10b 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 {