aboutsummaryrefslogtreecommitdiff
path: root/internal/markup/markup.go
diff options
context:
space:
mode:
authorᴜɴᴋɴᴡᴏɴ <u@gogs.io>2020-02-22 09:05:26 +0800
committerGitHub <noreply@github.com>2020-02-22 09:05:26 +0800
commit648d9e253c1924b832248f26fee42b2fb64dc3bc (patch)
tree51649fad974cd7284a47d30e412c90e7ab72cd2c /internal/markup/markup.go
parent5b14cc6f0b7b661beb2640a94bd15660cdb48587 (diff)
conf: overhaul server settings (#5928)
* conf: rename package * Requires Go 1.12 * Fix lint * Fix lint * Overhaul * db: fix tests * Save my work * Fix tests * Server.UnixSocketPermission * Server.LocalRootURL * SSH settings * Server.OfflineMode * Save my work * App.Version * Remove [server] STATIC_ROOT_PATH * Server.LandingURL
Diffstat (limited to 'internal/markup/markup.go')
-rw-r--r--internal/markup/markup.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/markup/markup.go b/internal/markup/markup.go
index 2bb56603..65b14865 100644
--- a/internal/markup/markup.go
+++ b/internal/markup/markup.go
@@ -13,8 +13,8 @@ import (
"github.com/unknwon/com"
"golang.org/x/net/html"
+ "gogs.io/gogs/internal/conf"
"gogs.io/gogs/internal/lazyregexp"
- "gogs.io/gogs/internal/setting"
"gogs.io/gogs/internal/tool"
)
@@ -78,7 +78,7 @@ func cutoutVerbosePrefix(prefix string) string {
if prefix[i] == '/' {
count++
}
- if count >= 3+setting.AppSubURLDepth {
+ if count >= 3+conf.Server.SubpathDepth {
return prefix[:i]
}
}
@@ -133,7 +133,7 @@ func RenderCrossReferenceIssueIndexPattern(rawBytes []byte, urlPrefix string, me
repo := string(m[:delimIdx])
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>`, conf.Server.ExternalURL, repo, index, m)
rawBytes = bytes.Replace(rawBytes, m, []byte(link), 1)
}
return rawBytes
@@ -155,7 +155,7 @@ func RenderSpecialLink(rawBytes []byte, urlPrefix string, metas map[string]strin
for _, m := range ms {
m = m[bytes.Index(m, []byte("@")):]
rawBytes = bytes.Replace(rawBytes, m,
- []byte(fmt.Sprintf(`<a href="%s/%s">%s</a>`, setting.AppSubURL, m[1:], m)), -1)
+ []byte(fmt.Sprintf(`<a href="%s/%s">%s</a>`, conf.Server.Subpath, m[1:], m)), -1)
}
rawBytes = RenderIssueIndexPattern(rawBytes, urlPrefix, metas)