deps: Upgrade github.com/alecthomas/chroma/v2 v2.4.0

This commit is contained in:
Bjørn Erik Pedersen
2022-11-18 09:53:31 +01:00
parent 00fe7e0408
commit bcb62d8911
5 changed files with 12 additions and 9 deletions

View File

@@ -95,7 +95,7 @@ func (cfg Config) ToHTMLOptions() []html.Option {
html.BaseLineNumber(cfg.LineNoStart),
html.LineNumbersInTable(cfg.LineNumbersInTable),
html.WithClasses(!cfg.NoClasses),
html.LinkableLineNumbers(cfg.AnchorLineNos, lineAnchors),
html.WithLinkableLineNumbers(cfg.AnchorLineNos, lineAnchors),
html.InlineCode(cfg.Hl_inline),
}

View File

@@ -86,8 +86,7 @@ User-Agent: foo
h := New(cfg)
result, _ := h.Highlight(lines, "bash", "")
// From Chroma v0.8.2 this is linkable: https://github.com/alecthomas/chroma/commit/ab61726cdb54d5a98b6efe7ed76af6aa0698ab4a
c.Assert(result, qt.Contains, "<span class=\"lnt\" id=\"2\"><a style=\"outline: none; text-decoration:none; color:inherit\" href=\"#2\">2</a>\n</span>")
c.Assert(result, qt.Contains, "<span class=\"lnt\" id=\"2\"><a class=\"lnlinks\" href=\"#2\">2</a>\n</span>")
result, _ = h.Highlight(lines, "bash", "lineanchors=test")
result, _ = h.Highlight(lines, "bash", "anchorlinenos=false,hl_lines=2")
c.Assert(result, qt.Not(qt.Contains), "id=\"2\"")