Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade chroma to v2.3.0 #21259

Merged
merged 10 commits into from
Sep 26, 2022
Prev Previous commit
Next Next commit
fmt
  • Loading branch information
silverwind committed Sep 25, 2022
commit 9da024544aa064afb72d248ad8f8c9a874372164
3 changes: 1 addition & 2 deletions modules/highlight/highlight.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ func File(fileName, language string, code []byte) ([]string, error) {
}
}


iterator, err := lexer.Tokenise(nil, string(code))
if err != nil {
return nil, fmt.Errorf("can't tokenize code: %w", err)
Expand All @@ -183,7 +182,7 @@ func File(fileName, language string, code []byte) ([]string, error) {
htmlWriter := bufio.NewWriter(&htmlBuf)

lines := []string{}
for _, tokens := range(tokensArray) {
for _, tokens := range tokensArray {
iterator := chroma.Literator(tokens...)
err = formatter.Format(htmlWriter, styles.GitHub, iterator)
if err != nil {
Expand Down