summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-02-04 22:51:40 -0500
committerUnknwon <u@gogs.io>2016-02-04 22:51:40 -0500
commit8e40f86d2c66268fcd4ff80ff5a35ba66cece581 (patch)
treea1369066739d2f3ef75c45b770adfba2c6bad73c
parentddf9fa06c7725820176ae75ae0b7e85c25f2886b (diff)
downloadgitea-8e40f86d2c66268fcd4ff80ff5a35ba66cece581.tar.gz
gitea-8e40f86d2c66268fcd4ff80ff5a35ba66cece581.zip
#2556 handle space in image URL
-rw-r--r--README.md2
-rw-r--r--gogs.go2
-rw-r--r--modules/base/markdown.go5
-rw-r--r--templates/.VERSION2
4 files changed, 7 insertions, 4 deletions
diff --git a/README.md b/README.md
index 19388b3130..fbbba565ab 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@ Gogs - Go Git Service [![Build Status](https://travis-ci.org/gogits/gogs.svg?bra
![](https://github.com/gogits/gogs/blob/master/public/img/gogs-large-resize.png?raw=true)
-##### Current version: 0.8.29
+##### Current version: 0.8.30
| Web | UI | Preview |
|:-------------:|:-------:|:-------:|
diff --git a/gogs.go b/gogs.go
index 9a6abf8dfb..7695d0478d 100644
--- a/gogs.go
+++ b/gogs.go
@@ -17,7 +17,7 @@ import (
"github.com/gogits/gogs/modules/setting"
)
-const APP_VER = "0.8.29.0204"
+const APP_VER = "0.8.30.0204"
func init() {
runtime.GOMAXPROCS(runtime.NumCPU())
diff --git a/modules/base/markdown.go b/modules/base/markdown.go
index 265deffa3e..8b3c8f435c 100644
--- a/modules/base/markdown.go
+++ b/modules/base/markdown.go
@@ -157,6 +157,8 @@ func (options *CustomRender) ListItem(out *bytes.Buffer, text []byte, flags int)
var (
svgSuffix = []byte(".svg")
svgSuffixWithMark = []byte(".svg?")
+ spaceBytes = []byte(" ")
+ spaceEncodedBytes = []byte("%20")
)
func (r *CustomRender) Image(out *bytes.Buffer, link []byte, title []byte, alt []byte) {
@@ -172,7 +174,8 @@ func (r *CustomRender) Image(out *bytes.Buffer, link []byte, title []byte, alt [
if link[0] != '/' {
prefix += "/"
}
- link = []byte(prefix + string(link))
+ link = bytes.Replace([]byte((prefix + string(link))), spaceBytes, spaceEncodedBytes, -1)
+ fmt.Println(333, string(link))
}
}
diff --git a/templates/.VERSION b/templates/.VERSION
index 17e89bcd61..44eb8eeeaf 100644
--- a/templates/.VERSION
+++ b/templates/.VERSION
@@ -1 +1 @@
-0.8.29.0204 \ No newline at end of file
+0.8.30.0204 \ No newline at end of file