From 912fe49ab3452c68b473d9c485be72610be061dc Mon Sep 17 00:00:00 2001 From: Gusted Date: Fri, 6 Sep 2024 20:24:51 +0200 Subject: [PATCH] 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 }