From 00ded76be8bc067f689194bc1ddb3f1e9ec79762 Mon Sep 17 00:00:00 2001 From: Renato Athaydes Date: Sat, 2 Jul 2022 11:49:50 +0200 Subject: [PATCH 1/3] Upgrade Chroma to v2. --- example/main.go | 2 +- go.mod | 2 +- go.sum | 6 ++++-- renderer.go | 8 ++++---- renderer_test.go | 6 +++--- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/example/main.go b/example/main.go index c316ca0..adf5e10 100644 --- a/example/main.go +++ b/example/main.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/Depado/bfchroma" - "github.com/alecthomas/chroma/formatters/html" + "github.com/alecthomas/chroma/v2/formatters/html" bf "github.com/russross/blackfriday/v2" ) diff --git a/go.mod b/go.mod index 77ad2ff..c2118c8 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/Depado/bfchroma go 1.17 require ( - github.com/alecthomas/chroma v0.10.0 + github.com/alecthomas/chroma/v2 v2.2.0 github.com/russross/blackfriday/v2 v2.1.0 github.com/stretchr/testify v1.7.0 ) diff --git a/go.sum b/go.sum index edaad3c..0eee8de 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,7 @@ -github.com/alecthomas/chroma v0.10.0 h1:7XDcGkCQopCNKjZHfYrNLraA+M7e0fMiJ/Mfikbfjek= -github.com/alecthomas/chroma v0.10.0/go.mod h1:jtJATyUxlIORhUOFNA9NZDWGAQ8wpxQQqNSB4rjA/1s= +github.com/alecthomas/chroma/v2 v2.2.0 h1:Aten8jfQwUqEdadVFFjNyjx7HTexhKP0XuqBG67mRDY= +github.com/alecthomas/chroma/v2 v2.2.0/go.mod h1:vf4zrexSH54oEjJ7EdB65tGNHmH3pGZmVkgTP5RHvAs= +github.com/alecthomas/repr v0.0.0-20220113201626-b1b626ac65ae h1:zzGwJfFlFGD94CyyYwCJeSuD32Gj9GTaSi5y9hoVzdY= +github.com/alecthomas/repr v0.0.0-20220113201626-b1b626ac65ae/go.mod h1:2kn6fqh/zIyPLmm3ugklbEi5hg5wS435eygvNfaDQL8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= diff --git a/renderer.go b/renderer.go index 7f511e5..a87e75a 100644 --- a/renderer.go +++ b/renderer.go @@ -5,10 +5,10 @@ package bfchroma import ( "io" - "github.com/alecthomas/chroma" - "github.com/alecthomas/chroma/formatters/html" - "github.com/alecthomas/chroma/lexers" - "github.com/alecthomas/chroma/styles" + "github.com/alecthomas/chroma/v2" + "github.com/alecthomas/chroma/v2/formatters/html" + "github.com/alecthomas/chroma/v2/lexers" + "github.com/alecthomas/chroma/v2/styles" bf "github.com/russross/blackfriday/v2" ) diff --git a/renderer_test.go b/renderer_test.go index b930b63..fd110ca 100644 --- a/renderer_test.go +++ b/renderer_test.go @@ -5,9 +5,9 @@ import ( "fmt" "testing" - "github.com/alecthomas/chroma" - "github.com/alecthomas/chroma/formatters/html" - "github.com/alecthomas/chroma/styles" + "github.com/alecthomas/chroma/v2" + "github.com/alecthomas/chroma/v2/formatters/html" + "github.com/alecthomas/chroma/v2/styles" bf "github.com/russross/blackfriday/v2" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" From e9909870d30b8a482545a9c867609f1bb77abea1 Mon Sep 17 00:00:00 2001 From: Renato Athaydes Date: Sat, 2 Jul 2022 11:53:06 +0200 Subject: [PATCH 2/3] Upgrade module version to v2 due to Chroma upgrade to v2. --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index c2118c8..85b2870 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/Depado/bfchroma +module github.com/Depado/bfchroma/v2 go 1.17 From fe22fc8908349988e1e823d660b386b40f41c954 Mon Sep 17 00:00:00 2001 From: Renato Athaydes Date: Sat, 2 Jul 2022 12:12:06 +0200 Subject: [PATCH 3/3] Avoid referring to bfchroma v1 in example. --- go.mod | 2 ++ 1 file changed, 2 insertions(+) diff --git a/go.mod b/go.mod index 85b2870..abef0ae 100644 --- a/go.mod +++ b/go.mod @@ -2,6 +2,8 @@ module github.com/Depado/bfchroma/v2 go 1.17 +replace github.com/Depado/bfchroma/v2 => ./ + require ( github.com/alecthomas/chroma/v2 v2.2.0 github.com/russross/blackfriday/v2 v2.1.0