mirror of https://github.com/gogs/gogs.git
Fix cross-repository reference link error (#4025)
parent
a6a3afd130
commit
0d73dcaf0f
2
gogs.go
2
gogs.go
|
@ -16,7 +16,7 @@ import (
|
||||||
"github.com/gogits/gogs/modules/setting"
|
"github.com/gogits/gogs/modules/setting"
|
||||||
)
|
)
|
||||||
|
|
||||||
const APP_VER = "0.9.122.0128"
|
const APP_VER = "0.9.123.0128"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
setting.AppVer = APP_VER
|
setting.AppVer = APP_VER
|
||||||
|
|
|
@ -196,6 +196,7 @@ var (
|
||||||
svgSuffixWithMark = []byte(".svg?")
|
svgSuffixWithMark = []byte(".svg?")
|
||||||
spaceBytes = []byte(" ")
|
spaceBytes = []byte(" ")
|
||||||
spaceEncodedBytes = []byte("%20")
|
spaceEncodedBytes = []byte("%20")
|
||||||
|
pound = []byte("#")
|
||||||
space = " "
|
space = " "
|
||||||
spaceEncoded = "%20"
|
spaceEncoded = "%20"
|
||||||
)
|
)
|
||||||
|
@ -284,9 +285,9 @@ func RenderCrossReferenceIssueIndexPattern(rawBytes []byte, urlPrefix string, me
|
||||||
m = m[1:] // ignore leading space or opening parentheses
|
m = m[1:] // ignore leading space or opening parentheses
|
||||||
}
|
}
|
||||||
|
|
||||||
fields := bytes.Split(m, []byte("#"))[0]
|
delimIdx := bytes.Index(m, pound)
|
||||||
repo := string(fields[0])
|
repo := string(m[:delimIdx])
|
||||||
index := string(fields[1])
|
index := string(m[delimIdx+1:])
|
||||||
|
|
||||||
link := fmt.Sprintf(`<a href="%s%s/issues/%s">%s</a>`, setting.AppUrl, repo, index, m)
|
link := fmt.Sprintf(`<a href="%s%s/issues/%s">%s</a>`, setting.AppUrl, repo, index, m)
|
||||||
rawBytes = bytes.Replace(rawBytes, m, []byte(link), 1)
|
rawBytes = bytes.Replace(rawBytes, m, []byte(link), 1)
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
0.9.122.0128
|
0.9.123.0128
|
Loading…
Reference in New Issue