1
0
mirror of https://github.com/alecthomas/chroma.git synced 2025-03-17 20:58:08 +02:00

fix: bad path normalisation

This commit is contained in:
Alec Thomas 2023-11-13 08:41:30 +11:00
parent 09953ff50f
commit 96a12e377e

View File

@ -371,7 +371,11 @@ func selexer(path, contents string) (lexer chroma.Lexer, err error) {
if err != nil {
return nil, err
}
path, err := filepath.Rel(cwd, cli.Lexer)
absPath, err := filepath.Abs(cli.Lexer)
if err != nil {
return nil, err
}
path, err := filepath.Rel(cwd, absPath)
if err != nil {
return nil, err
}