From 0911ba864621a68bde0e4f15764ee234e67d61d8 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 6 Sep 2024 02:02:54 +0000 Subject: [PATCH 1/2] Update module github.com/buildkite/terminal-to-html/v3 to v3.16.0 --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 4235c96f03..733ba4c342 100644 --- a/go.mod +++ b/go.mod @@ -23,7 +23,7 @@ require ( github.com/alecthomas/chroma/v2 v2.14.0 github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb github.com/blevesearch/bleve/v2 v2.4.2 - github.com/buildkite/terminal-to-html/v3 v3.15.0 + github.com/buildkite/terminal-to-html/v3 v3.16.0 github.com/caddyserver/certmagic v0.21.0 github.com/chi-middleware/proxy v1.1.1 github.com/djherbis/buffer v1.2.0 diff --git a/go.sum b/go.sum index ea27e6dd03..87a1059aab 100644 --- a/go.sum +++ b/go.sum @@ -141,8 +141,8 @@ github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs= github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c= github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA= github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0= -github.com/buildkite/terminal-to-html/v3 v3.15.0 h1:wYZmEsdqYB7g2cSJGbue3Q+vZzcRhty/9fzLxcd+C/8= -github.com/buildkite/terminal-to-html/v3 v3.15.0/go.mod h1:gBOS1jmZ+/ze1lpunGDIZpjCk3MkYZ4E80Y7/26Um0c= +github.com/buildkite/terminal-to-html/v3 v3.16.0 h1:BbAgSK3tLEVocul3QLWn5pazyMzWilEeSmnq2LGcFAM= +github.com/buildkite/terminal-to-html/v3 v3.16.0/go.mod h1:gBOS1jmZ+/ze1lpunGDIZpjCk3MkYZ4E80Y7/26Um0c= github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/caddyserver/certmagic v0.21.0 h1:yDoifClc4hIxhHer3AxUj4buhF+NzRR6torw/AOnuUE= github.com/caddyserver/certmagic v0.21.0/go.mod h1:OgUZNXYV/ylYoFJNmoYVR5nntydLNMQISePPgqZTyhc= From 912fe49ab3452c68b473d9c485be72610be061dc Mon Sep 17 00:00:00 2001 From: Gusted Date: Fri, 6 Sep 2024 20:24:51 +0200 Subject: [PATCH 2/2] Construct screen --- modules/markup/console/console.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/markup/console/console.go b/modules/markup/console/console.go index 7c4050a721..f544ab218d 100644 --- a/modules/markup/console/console.go +++ b/modules/markup/console/console.go @@ -58,13 +58,16 @@ func (Renderer) CanRender(filename string, input io.Reader) bool { // Render renders terminal colors to HTML with all specific handling stuff. func (Renderer) Render(ctx *markup.RenderContext, input io.Reader, output io.Writer) error { - screen := &trend.Screen{} + screen, err := trend.NewScreen() + if err != nil { + return err + } if _, err := io.Copy(screen, input); err != nil { return err } buf := screen.AsHTML() buf = strings.ReplaceAll(buf, "\n", `
`) - _, err := output.Write([]byte(buf)) + _, err = output.Write([]byte(buf)) return err }