Skip to content

Commit

Permalink
Fix a highlighting issue
Browse files Browse the repository at this point in the history
Reported here:
#236 (comment)
  • Loading branch information
walles committed Aug 11, 2024
1 parent 6cf1223 commit 37cf840
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions m/highlight.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 37cf840

Please sign in to comment.