Refactor code render and render control chars (#37078)

Fix #37057
This commit is contained in:
wxiaoguang
2026-04-03 12:10:01 +08:00
committed by GitHub
parent 7b17234945
commit 6eed75af24
8 changed files with 173 additions and 97 deletions
+5 -1
View File
@@ -16,7 +16,11 @@ import (
"github.com/go-enry/go-enry/v2"
)
const mapKeyLowerPrefix = "lower/"
const (
mapKeyLowerPrefix = "lower/"
LanguagePlaintext = "plaintext"
chromaLexerFallback = "fallback"
)
// chromaLexers is fully managed by us to do fast lookup for chroma lexers by file name or language name
// Don't use lexers.Get because it is very slow in many cases (iterate all rules, filepath glob match, etc.)