deps: Update github.com/alecthomas/chroma v0.9.4 => v0.10.0
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Mon, 14 Feb 2022 12:27:17 +0000 (13:27 +0100)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 15 Feb 2022 09:37:14 +0000 (10:37 +0100)
docs/data/docs.json
go.mod
go.sum
hugolib/embedded_shortcodes_test.go
hugolib/page_test.go
markup/goldmark/convert_test.go
markup/highlight/highlight_test.go

index 28a33c697e1036297ddb79ac3b85fd9e9f85ff70..68a3f8cc7ca6a1d2075ffccf1ac154a95a3ad964 100644 (file)
           "bibtex"
         ]
       },
+      {
+        "Name": "Bicep",
+        "Aliases": [
+          "bicep"
+        ]
+      },
       {
         "Name": "BlitzBasic",
         "Aliases": [
           "onesenterprise"
         ]
       },
+      {
+        "Name": "OpenEdge ABL",
+        "Aliases": [
+          "abl",
+          "cls",
+          "i",
+          "openedge",
+          "openedgeabl",
+          "p",
+          "progress",
+          "w"
+        ]
+      },
       {
         "Name": "OpenSCAD",
         "Aliases": [
           "txt"
         ]
       },
+      {
+        "Name": "Plutus Core",
+        "Aliases": [
+          "plc",
+          "plutus-core"
+        ]
+      },
       {
         "Name": "Pony",
         "Aliases": [
       {
         "Name": "XML",
         "Aliases": [
+          "csproj",
+          "fsproj",
           "rss",
           "svg",
+          "vcxproj",
           "wsdl",
           "wsf",
           "xml",
           "yang"
         ]
       },
+      {
+        "Name": "Zed",
+        "Aliases": [
+          "zed"
+        ]
+      },
       {
         "Name": "Zig",
         "Aliases": [
         "type": "application/javascript",
         "string": "application/javascript",
         "suffixes": [
-          "js"
+          "js",
+          "jsm",
+          "mjs"
         ]
       },
       {
diff --git a/go.mod b/go.mod
index 975c23af59619e79fe8ac38cdc86e1341e2f45c2..e206785adcbcd5d6091071517956bc35b486a262 100644 (file)
--- a/go.mod
+++ b/go.mod
@@ -4,7 +4,7 @@ require (
        github.com/BurntSushi/locker v0.0.0-20171006230638-a6e239ea1c69
        github.com/PuerkitoBio/purell v1.1.1
        github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
-       github.com/alecthomas/chroma v0.9.4
+       github.com/alecthomas/chroma v0.10.0
        github.com/armon/go-radix v1.0.0
        github.com/aws/aws-sdk-go v1.41.14
        github.com/bep/debounce v1.2.0
diff --git a/go.sum b/go.sum
index a2bdd4ae0f07a15539e495ba5e9989c20f6d3144..7662d93c31060d8658a16af0481c8885851250c4 100644 (file)
--- a/go.sum
+++ b/go.sum
@@ -113,6 +113,8 @@ github.com/alecthomas/chroma v0.7.2-0.20200305040604-4f3623dce67a/go.mod h1:fv5S
 github.com/alecthomas/chroma v0.8.2/go.mod h1:sko8vR34/90zvl5QdcUdvzL3J8NKjAUx9va9jPuFNoM=
 github.com/alecthomas/chroma v0.9.4 h1:YL7sOAE3p8HS96T9km7RgvmsZIctqbK1qJ0b7hzed44=
 github.com/alecthomas/chroma v0.9.4/go.mod h1:jtJATyUxlIORhUOFNA9NZDWGAQ8wpxQQqNSB4rjA/1s=
+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/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=
 github.com/alecthomas/kong v0.2.1-0.20190708041108-0548c6b1afae/go.mod h1:+inYUSluD+p4L8KdviBSgzcqEjUQOfC5fQDRFuc36lI=
index 895b3a9595184c9a6926a31e95ee6b9ed89b7819..ba0abe43b74cdf34a320ba4e8e60a33e1ad818e2 100644 (file)
@@ -89,13 +89,13 @@ func TestShortcodeHighlight(t *testing.T) {
                        `{{< highlight java >}}
 void do();
 {{< /highlight >}}`,
-                       `(?s)<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-java"`,
+                       `(?s)<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java"`,
                },
                {
                        `{{< highlight java "style=friendly" >}}
 void do();
 {{< /highlight >}}`,
-                       `(?s)<div class="highlight"><pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-java" data-lang="java">`,
+                       `(?s)<div class="highlight"><pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java">`,
                },
        } {
 
index 5e89278e1f4b23e4ae20869782fe4d79aa8dd9cf..6b35e48144a3561232e66de257128f8b88510a00 100644 (file)
@@ -1914,8 +1914,8 @@ Link with URL as text
        b.AssertFileContent("public/page/index.html",
                `<nav id="TableOfContents">
 <li><a href="#shortcode-t-short-in-header">Shortcode T-SHORT in header</a></li>
-<code class="language-bash" data-lang="bash"><span class="hl">SHORT
-<code class="language-bash" data-lang="bash"><span class="hl">MARKDOWN
+<code class="language-bash" data-lang="bash"><span class="line hl"><span class="cl">SHORT
+<code class="language-bash" data-lang="bash"><span class="line hl"><span class="cl">MARKDOWN
 <p><a href="https://google.com">https://google.com</a></p>
 `)
 }
index 5fe6997e88e9882dc8f55cd053932864ca468323..684f22c5455b01e39ca8b6dcd3174b8a8442204f 100644 (file)
@@ -154,7 +154,7 @@ description
        c.Assert(got, qt.Contains, `<h2 id="神真美好-2">神真美好</h2>`, qt.Commentf(got))
 
        // Code fences
-       c.Assert(got, qt.Contains, "<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-bash\" data-lang=\"bash\">LINE1\n</code></pre></div>")
+       c.Assert(got, qt.Contains, "<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-bash\" data-lang=\"bash\"><span class=\"line\"><span class=\"cl\">LINE1\n</span></span></code></pre></div>")
        c.Assert(got, qt.Contains, "Code Fences No Lexer</h2>\n<pre tabindex=\"0\"><code class=\"language-moo\" data-lang=\"moo\">LINE1\n</code></pre>")
 
        // Extensions
@@ -263,8 +263,10 @@ func TestConvertAttributes(t *testing.T) {
                                conf.Highlight.CodeFences = true
                        },
                        "```bash {linenos=table .myclass id=\"myid\"}\necho 'foo';\n````\n{ .adfadf }",
-                       []string{"div class=\"highlight myclass\" id=\"myid\"><div s",
-                               "table style"},
+                       []string{
+                               "div class=\"highlight myclass\" id=\"myid\"><div s",
+                               "table style",
+                       },
                },
                {
                        "Paragraph",
@@ -326,10 +328,8 @@ func TestConvertAttributes(t *testing.T) {
                        for _, s := range cast.ToStringSlice(test.expect) {
                                c.Assert(got, qt.Contains, s)
                        }
-
                })
        }
-
 }
 
 func TestConvertIssues(t *testing.T) {
@@ -389,8 +389,7 @@ LINE5
 
                result := convertForConfig(c, cfg, `echo "Hugo Rocks!"`, "bash")
                // TODO(bep) there is a whitespace mismatch (\n) between this and the highlight template func.
-               c.Assert(result, qt.Equals, `<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="nb">echo</span> <span class="s2">&#34;Hugo Rocks!&#34;</span>
-</code></pre></div>`)
+               c.Assert(result, qt.Equals, "<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-bash\" data-lang=\"bash\"><span class=\"line\"><span class=\"cl\"><span class=\"nb\">echo</span> <span class=\"s2\">&#34;Hugo Rocks!&#34;</span>\n</span></span></code></pre></div>")
                result = convertForConfig(c, cfg, `echo "Hugo Rocks!"`, "unknown")
                c.Assert(result, qt.Equals, "<pre tabindex=\"0\"><code class=\"language-unknown\" data-lang=\"unknown\">echo &quot;Hugo Rocks!&quot;\n</code></pre>")
        })
@@ -404,7 +403,7 @@ LINE5
                c.Assert(result, qt.Contains, "<span class=\"hl\"><span class=\"lnt\">4")
 
                result = convertForConfig(c, cfg, lines, "bash {linenos=inline,hl_lines=[2]}")
-               c.Assert(result, qt.Contains, "<span class=\"ln\">2</span>LINE2\n</span>")
+               c.Assert(result, qt.Contains, "<span class=\"ln\">2</span><span class=\"cl\">LINE2\n</span></span>")
                c.Assert(result, qt.Not(qt.Contains), "<table")
 
                result = convertForConfig(c, cfg, lines, "bash {linenos=true,hl_lines=[2]}")
@@ -431,7 +430,7 @@ LINE5
                cfg.LineNumbersInTable = false
 
                result := convertForConfig(c, cfg, lines, "bash")
-               c.Assert(result, qt.Contains, "<span class=\"ln\">2</span>LINE2\n<")
+               c.Assert(result, qt.Contains, "<span class=\"ln\">2</span><span class=\"cl\">LINE2\n</span>")
                result = convertForConfig(c, cfg, lines, "bash {linenos=table}")
                c.Assert(result, qt.Contains, "<span class=\"lnt\">1\n</span>")
        })
@@ -454,6 +453,6 @@ LINE5
                cfg.LineNumbersInTable = false
 
                result := convertForConfig(c, cfg, lines, "")
-               c.Assert(result, qt.Contains, "<span class=\"ln\">2</span>LINE2\n<")
+               c.Assert(result, qt.Contains, "<span class=\"ln\">2</span><span class=\"cl\">LINE2\n</span></span>")
        })
 }
index f68df629a40d1a442e7619df1331aecff3d44aab..53e53b1d9d2a3874cd21408ac204d5b8209c504b 100644 (file)
@@ -43,7 +43,7 @@ User-Agent: foo
                h := New(cfg)
 
                result, _ := h.Highlight(`echo "Hugo Rocks!"`, "bash", "")
-               c.Assert(result, qt.Equals, `<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="nb">echo</span> <span class="s2">&#34;Hugo Rocks!&#34;</span></code></pre></div>`)
+               c.Assert(result, qt.Equals, `<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="nb">echo</span> <span class="s2">&#34;Hugo Rocks!&#34;</span></span></span></code></pre></div>`)
                result, _ = h.Highlight(`echo "Hugo Rocks!"`, "unknown", "")
                c.Assert(result, qt.Equals, `<pre tabindex="0"><code class="language-unknown" data-lang="unknown">echo &#34;Hugo Rocks!&#34;</code></pre>`)
        })
@@ -58,7 +58,7 @@ User-Agent: foo
                c.Assert(result, qt.Contains, "<span class=\"hl\"><span class=\"lnt\">4")
 
                result, _ = h.Highlight(lines, "bash", "linenos=inline,hl_lines=2")
-               c.Assert(result, qt.Contains, "<span class=\"ln\">2</span>LINE2\n</span>")
+               c.Assert(result, qt.Contains, "<span class=\"ln\">2</span><span class=\"cl\">LINE2\n</span></span>")
                c.Assert(result, qt.Not(qt.Contains), "<table")
 
                result, _ = h.Highlight(lines, "bash", "linenos=true,hl_lines=2")
@@ -101,7 +101,7 @@ User-Agent: foo
                h := New(cfg)
 
                result, _ := h.Highlight(lines, "bash", "")
-               c.Assert(result, qt.Contains, "<span class=\"ln\">2</span>LINE2\n<")
+               c.Assert(result, qt.Contains, "<span class=\"cl\">LINE2\n</span></span>")
                result, _ = h.Highlight(lines, "bash", "linenos=table")
                c.Assert(result, qt.Contains, "<span class=\"lnt\">1\n</span>")
        })
@@ -125,7 +125,7 @@ User-Agent: foo
                h := New(cfg)
 
                result, _ := h.Highlight(lines, "", "")
-               c.Assert(result, qt.Contains, "<span class=\"ln\">2</span>LINE2\n<")
+               c.Assert(result, qt.Contains, "<span class=\"cl\">LINE2\n</span></span>")
        })
 
        c.Run("No language, Escape HTML string", func(c *qt.C) {