1
1
mirror of https://github.com/walles/moar.git synced 2024-11-22 21:50:43 +03:00

Fix a highlighting issue

Reported here:
https://github.com/walles/moar/issues/236#issuecomment-2282677792
This commit is contained in:
Johan Walles 2024-08-11 16:34:29 +02:00
parent 6cf1223634
commit 37cf840879

View File

@ -28,10 +28,14 @@ func highlight(text string, style chroma.Style, formatter chroma.Formatter, lexe
return nil, nil
}
// See: https://github.com/alecthomas/chroma#identifying-the-language
// FIXME: Do we actually need this? We should profile our reader performance
// with and without.
lexer = chroma.Coalesce(lexer)
// NOTE: We used to do...
//
// lexer = chroma.Coalesce(lexer)
//
// ... here, but with Chroma 2.12.0 that resulted in this problem:
// https://github.com/walles/moar/issues/236#issuecomment-2282677792
//
// So let's not do that anymore.
iterator, err := lexer.Tokenise(nil, text)
if err != nil {