Update chroma to 2.2.0, line number links appeared.
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2022-08-14 14:57:54 +05:00
parent 25489dc103
commit 59dafc373f
4 changed files with 12 additions and 6 deletions

View File

@@ -6,10 +6,9 @@ import (
"strconv"
"time"
"github.com/alecthomas/chroma"
htmlfmt "github.com/alecthomas/chroma/formatters/html"
"github.com/alecthomas/chroma/lexers"
"github.com/alecthomas/chroma/styles"
htmlfmt "github.com/alecthomas/chroma/v2/formatters/html"
"github.com/alecthomas/chroma/v2/lexers"
"github.com/alecthomas/chroma/v2/styles"
"github.com/labstack/echo"
"go.dev.pztrn.name/fastpastebin/internal/database/dialects/flatfiles"
"go.dev.pztrn.name/fastpastebin/internal/structs"
@@ -167,7 +166,7 @@ func pasteGETWebInterface(ectx echo.Context) error {
style = styles.Fallback
}
// Get HTML formatter.
formatter := chroma.Formatter(htmlfmt.New(htmlfmt.WithLineNumbers(true), htmlfmt.LineNumbersInTable(true), htmlfmt.LinkableLineNumbers(true, "L")))
formatter := htmlfmt.New(htmlfmt.WithLineNumbers(true), htmlfmt.LineNumbersInTable(true), htmlfmt.LinkableLineNumbers(true, "L"))
// Create buffer and format into it.
buf := new(bytes.Buffer)