New Upstream Release - golang-github-yuin-goldmark-highlighting

Ready changes

Summary

Merged new upstream version: 0.0~git20220924.1513624 (was: 0.0~git20220208.594be19).

Diff

diff --git a/README.md b/README.md
index 857b61b..5f33672 100644
--- a/README.md
+++ b/README.md
@@ -11,7 +11,7 @@ Installation
 --------------------
 
 ```
-go get github.com/yuin/goldmark-highlighting
+go get github.com/yuin/goldmark-highlighting/v2
 ```
 
 Usage
@@ -25,7 +25,7 @@ import (
     "github.com/yuin/goldmark"
     "github.com/yuin/goldmark/extension"
     "github.com/yuin/goldmark/parser"
-    "github.com/yuin/goldmark-highlighting"
+    "github.com/yuin/goldmark-highlighting/v2"
 
 )
 
diff --git a/debian/changelog b/debian/changelog
index 9c299f8..e0759af 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+golang-github-yuin-goldmark-highlighting (0.0~git20220924.1513624-1) UNRELEASED; urgency=low
+
+  * New upstream snapshot.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Fri, 23 Jun 2023 17:54:39 -0000
+
 golang-github-yuin-goldmark-highlighting (0.0~git20220208.594be19-1) unstable; urgency=medium
 
   * New upstream version 0.0~git20220208.594be19
diff --git a/go.mod b/go.mod
index d5e4a6f..e45a3d8 100644
--- a/go.mod
+++ b/go.mod
@@ -1,8 +1,9 @@
-module github.com/yuin/goldmark-highlighting
+module github.com/yuin/goldmark-highlighting/v2
 
 go 1.13
 
 require (
-	github.com/alecthomas/chroma v0.10.0
-	github.com/yuin/goldmark v1.4.5
+	github.com/alecthomas/chroma/v2 v2.2.0
+	github.com/dlclark/regexp2 v1.7.0 // indirect
+	github.com/yuin/goldmark v1.4.15
 )
diff --git a/go.sum b/go.sum
index a930dc4..7aaee6a 100644
--- a/go.sum
+++ b/go.sum
@@ -1,19 +1,20 @@
-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=
-github.com/dlclark/regexp2 v1.4.0 h1:F1rxgk7p4uKjwIQxBs9oAXe5CqrXlCduYEJvrF4u93E=
 github.com/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
+github.com/dlclark/regexp2 v1.7.0 h1:7lJfhqlPssTb1WQx4yvTHN0uElPEv52sbaECrAQxjAo=
+github.com/dlclark/regexp2 v1.7.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
 github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
 github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
 github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
 github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
 github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
-github.com/yuin/goldmark v1.4.4 h1:zNWRjYUW32G9KirMXYHQHVNFkXvMI7LpgNW2AgYAoIs=
-github.com/yuin/goldmark v1.4.4/go.mod h1:rmuwmfZ0+bvzB24eSC//bk1R1Zp3hM0OXYv/G2LIilg=
-github.com/yuin/goldmark v1.4.5 h1:4OEQwtW2uLXjEdgnGM3Vg652Pq37X7NOIRzFWb3BzIc=
-github.com/yuin/goldmark v1.4.5/go.mod h1:rmuwmfZ0+bvzB24eSC//bk1R1Zp3hM0OXYv/G2LIilg=
+github.com/yuin/goldmark v1.4.15 h1:CFa84T0goNn/UIXYS+dmjjVxMyTAvpOmzld40N/nfK0=
+github.com/yuin/goldmark v1.4.15/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
diff --git a/highlighting.go b/highlighting.go
index ffdaaed..d14408a 100644
--- a/highlighting.go
+++ b/highlighting.go
@@ -18,10 +18,10 @@ import (
 	"github.com/yuin/goldmark/text"
 	"github.com/yuin/goldmark/util"
 
-	"github.com/alecthomas/chroma"
-	chromahtml "github.com/alecthomas/chroma/formatters/html"
-	"github.com/alecthomas/chroma/lexers"
-	"github.com/alecthomas/chroma/styles"
+	"github.com/alecthomas/chroma/v2"
+	chromahtml "github.com/alecthomas/chroma/v2/formatters/html"
+	"github.com/alecthomas/chroma/v2/lexers"
+	"github.com/alecthomas/chroma/v2/styles"
 )
 
 // ImmutableAttributes is a read-only interface for ast.Attributes.
diff --git a/highlighting_test.go b/highlighting_test.go
index 5813639..1b8e96e 100644
--- a/highlighting_test.go
+++ b/highlighting_test.go
@@ -6,8 +6,8 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/alecthomas/chroma"
-	chromahtml "github.com/alecthomas/chroma/formatters/html"
+	"github.com/alecthomas/chroma/v2"
+	chromahtml "github.com/alecthomas/chroma/v2/formatters/html"
 	"github.com/yuin/goldmark"
 	"github.com/yuin/goldmark/testutil"
 	"github.com/yuin/goldmark/util"
@@ -76,7 +76,7 @@ Title
 		t.Error("failed to render HTML\n")
 	}
 
-	expected := strings.TrimSpace(`/* Background */ .bg { color: #f8f8f2; background-color: #272822 }
+	expected := strings.TrimSpace(`/* Background */ .bg { color: #f8f8f2; background-color: #272822; }
 /* PreWrapper */ .chroma { color: #f8f8f2; background-color: #272822; }
 /* LineNumbers targeted by URL anchor */ .chroma .ln:target { color: #f8f8f2; background-color: #3c3d38 }
 /* LineNumbersTable targeted by URL anchor */ .chroma .lnt:target { color: #f8f8f2; background-color: #3c3d38 }
@@ -306,7 +306,7 @@ Title
 		t.Error("failed to render HTML", buffer.String())
 	}
 
-	expected := strings.TrimSpace(`/* Background */ .bg { color: #cccccc; background-color: #1d1d1d }
+	expected := strings.TrimSpace(`/* Background */ .bg { color: #cccccc; background-color: #1d1d1d; }
 /* PreWrapper */ .chroma { color: #cccccc; background-color: #1d1d1d; }
 /* LineNumbers targeted by URL anchor */ .chroma .ln:target { color: #cccccc; background-color: #333333 }
 /* LineNumbersTable targeted by URL anchor */ .chroma .lnt:target { color: #cccccc; background-color: #333333 }
@@ -428,6 +428,14 @@ LINE8
 	}
 }
 
+type nopPreWrapper struct{}
+
+// Start is called to write a start <pre> element.
+func (nopPreWrapper) Start(code bool, styleAttr string) string { return "" }
+
+// End is called to write the end </pre> element.
+func (nopPreWrapper) End(code bool) string { return "" }
+
 func TestHighlightingLinenos(t *testing.T) {
 	outputLineNumbersInTable := `<div class="chroma">
 <table class="lntable"><tr><td class="lntd">
@@ -464,7 +472,7 @@ func TestHighlightingLinenos(t *testing.T) {
 						WithFormatOptions(
 							chromahtml.WithLineNumbers(test.lineNumbers),
 							chromahtml.LineNumbersInTable(test.lineNumbersInTable),
-							chromahtml.PreventSurroundingPre(true),
+							chromahtml.WithPreWrapper(nopPreWrapper{}),
 							chromahtml.WithClasses(true),
 						),
 					),

More details

Full run details

Historical runs