summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authortechknowlogick <techknowlogick@gitea.io>2023-03-14 16:09:01 -0400
committerGitHub <noreply@github.com>2023-03-14 16:09:01 -0400
commit32204fcf8bf780143f93165281b899c58a5a3f9c (patch)
tree46ec67455fb1fbd127142945a51994ed467c2a43 /modules
parent6e75739c5ba1de30c37adbd9e590674b583912c2 (diff)
downloadgitea-32204fcf8bf780143f93165281b899c58a5a3f9c.tar.gz
gitea-32204fcf8bf780143f93165281b899c58a5a3f9c.zip
test_env: hardcode major go version in use (#23464)
hardcode the version of test_env we use in docker, so that we can use different major versions of golang between versions of Gitea --------- Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'modules')
-rw-r--r--modules/highlight/highlight.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/highlight/highlight.go b/modules/highlight/highlight.go
index a5c38940a7..fac682b8a8 100644
--- a/modules/highlight/highlight.go
+++ b/modules/highlight/highlight.go
@@ -36,6 +36,8 @@ var (
once sync.Once
cache *lru.TwoQueueCache
+
+ githubStyles = styles.Get("github")
)
// NewContext loads custom highlight map from local config
@@ -121,7 +123,7 @@ func CodeFromLexer(lexer chroma.Lexer, code string) string {
return code
}
// style not used for live site but need to pass something
- err = formatter.Format(htmlw, styles.GitHub, iterator)
+ err = formatter.Format(htmlw, githubStyles, iterator)
if err != nil {
log.Error("Can't format code: %v", err)
return code
@@ -184,7 +186,7 @@ func File(fileName, language string, code []byte) ([]string, string, error) {
lines := make([]string, 0, len(tokensLines))
for _, tokens := range tokensLines {
iterator = chroma.Literator(tokens...)
- err = formatter.Format(htmlBuf, styles.GitHub, iterator)
+ err = formatter.Format(htmlBuf, githubStyles, iterator)
if err != nil {
return nil, "", fmt.Errorf("can't format code: %w", err)
}