From b298c06e0551e3eba10b39ae5668b7a6a36a08a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Fri, 20 Nov 2020 09:30:05 +0100 Subject: [PATCH] deps: Update to Chroma v0.8.2 Closes #7970 --- go.mod | 3 ++- go.sum | 6 ++++-- markup/highlight/highlight_test.go | 4 ++-- .../go_templates/htmltemplate/testdata/file1.tmpl | 2 ++ .../go_templates/htmltemplate/testdata/file2.tmpl | 2 ++ .../go_templates/htmltemplate/testdata/fs.zip | Bin 0 -> 406 bytes .../go_templates/htmltemplate/testdata/tmpl1.tmpl | 3 +++ .../go_templates/htmltemplate/testdata/tmpl2.tmpl | 3 +++ 8 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 tpl/internal/go_templates/htmltemplate/testdata/file1.tmpl create mode 100644 tpl/internal/go_templates/htmltemplate/testdata/file2.tmpl create mode 100644 tpl/internal/go_templates/htmltemplate/testdata/fs.zip create mode 100644 tpl/internal/go_templates/htmltemplate/testdata/tmpl1.tmpl create mode 100644 tpl/internal/go_templates/htmltemplate/testdata/tmpl2.tmpl diff --git a/go.mod b/go.mod index 055afaf9d..095f006e8 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ require ( github.com/BurntSushi/toml v0.3.1 github.com/PuerkitoBio/purell v1.1.1 github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect - github.com/alecthomas/chroma v0.8.1 + github.com/alecthomas/chroma v0.8.2 github.com/alecthomas/repr v0.0.0-20181024024818-d37bc2a10ba1 // indirect github.com/armon/go-radix v1.0.0 github.com/aws/aws-sdk-go v1.35.0 @@ -14,6 +14,7 @@ require ( github.com/bep/golibsass v0.7.0 github.com/bep/tmc v0.5.1 github.com/disintegration/gift v1.2.1 + github.com/dlclark/regexp2 v1.4.0 // indirect github.com/dustin/go-humanize v1.0.0 github.com/evanw/esbuild v0.8.11 github.com/fortytw2/leaktest v1.3.0 diff --git a/go.sum b/go.sum index 20c2f9b81..0a950535a 100644 --- a/go.sum +++ b/go.sum @@ -58,8 +58,8 @@ github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkK github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38 h1:smF2tmSOzy2Mm+0dGI2AIUHY+w0BUc+4tn40djz7+6U= github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38/go.mod h1:r7bzyVFMNntcxPZXK3/+KdruV1H5KSlyVY0gc+NgInI= github.com/alecthomas/chroma v0.7.2-0.20200305040604-4f3623dce67a/go.mod h1:fv5SzZPFJbwp2NXJWpFIX7DZS4HgV1K4ew4Pc2OZD9s= -github.com/alecthomas/chroma v0.8.1 h1:ym20sbvyC6RXz45u4qDglcgr8E313oPROshcuCHqiEE= -github.com/alecthomas/chroma v0.8.1/go.mod h1:sko8vR34/90zvl5QdcUdvzL3J8NKjAUx9va9jPuFNoM= +github.com/alecthomas/chroma v0.8.2 h1:x3zkuE2lUk/RIekyAJ3XRqSCP4zwWDfcw/YJCuCAACg= +github.com/alecthomas/chroma v0.8.2/go.mod h1:sko8vR34/90zvl5QdcUdvzL3J8NKjAUx9va9jPuFNoM= github.com/alecthomas/colour v0.0.0-20160524082231-60882d9e2721 h1:JHZL0hZKJ1VENNfmXvHbgYlbUOvpzYzvy2aZU5gXVeo= github.com/alecthomas/colour v0.0.0-20160524082231-60882d9e2721/go.mod h1:QO9JBoKquHd+jz9nshCh40fOfO+JzsoXy8qTHF68zU0= github.com/alecthomas/kong v0.1.17-0.20190424132513-439c674f7ae0/go.mod h1:+inYUSluD+p4L8KdviBSgzcqEjUQOfC5fQDRFuc36lI= @@ -127,6 +127,8 @@ github.com/dlclark/regexp2 v1.1.6 h1:CqB4MjHw0MFCDj+PHHjiESmHX+N7t0tJzKvC6M97BRg github.com/dlclark/regexp2 v1.1.6/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= github.com/dlclark/regexp2 v1.2.0 h1:8sAhBGEM0dRWogWqWyQeIJnxjWO6oIjl8FKqREDsGfk= github.com/dlclark/regexp2 v1.2.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= +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/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= diff --git a/markup/highlight/highlight_test.go b/markup/highlight/highlight_test.go index f5992a512..228d5e8c9 100644 --- a/markup/highlight/highlight_test.go +++ b/markup/highlight/highlight_test.go @@ -87,9 +87,9 @@ User-Agent: foo h := New(cfg) result, _ := h.Highlight(lines, "bash", "") - c.Assert(result, qt.Contains, "2\n") + // From Chroma v0.8.2 this is linkable: https://github.com/alecthomas/chroma/commit/ab61726cdb54d5a98b6efe7ed76af6aa0698ab4a + c.Assert(result, qt.Contains, "2\n") result, _ = h.Highlight(lines, "bash", "lineanchors=test") - c.Assert(result, qt.Contains, "2\n") result, _ = h.Highlight(lines, "bash", "anchorlinenos=false,hl_lines=2") c.Assert(result, qt.Not(qt.Contains), "id=\"2\"") }) diff --git a/tpl/internal/go_templates/htmltemplate/testdata/file1.tmpl b/tpl/internal/go_templates/htmltemplate/testdata/file1.tmpl new file mode 100644 index 000000000..febf9d9f8 --- /dev/null +++ b/tpl/internal/go_templates/htmltemplate/testdata/file1.tmpl @@ -0,0 +1,2 @@ +{{define "x"}}TEXT{{end}} +{{define "dotV"}}{{.V}}{{end}} diff --git a/tpl/internal/go_templates/htmltemplate/testdata/file2.tmpl b/tpl/internal/go_templates/htmltemplate/testdata/file2.tmpl new file mode 100644 index 000000000..39bf6fb9e --- /dev/null +++ b/tpl/internal/go_templates/htmltemplate/testdata/file2.tmpl @@ -0,0 +1,2 @@ +{{define "dot"}}{{.}}{{end}} +{{define "nested"}}{{template "dot" .}}{{end}} diff --git a/tpl/internal/go_templates/htmltemplate/testdata/fs.zip b/tpl/internal/go_templates/htmltemplate/testdata/fs.zip new file mode 100644 index 0000000000000000000000000000000000000000..8581313ae36f2b3980e320f3a8f747db9727386a GIT binary patch literal 406 zcmWIWW@Zs#U|`^2;3#<;P@%SDw+@hJ1jJknG7KfT1v!R#ATl(BlYx2t3ZD4q!ou;T z72FJrEV`i#3@pL%j11bIXLV0_>Uf$yS+&m3)A#fl@6do%0jt)oU9ryZtoO>btX$I_ zrfO(}GO6xh2tct<