From d6c1b7fa732614397b7f7d7cd69626d7adcb46e0 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Thu, 28 Nov 2019 02:20:58 +0100 Subject: [PATCH] Render each paragraph individually and reflow text only inside paragraphs --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index c282da7..17de092 100644 --- a/main.go +++ b/main.go @@ -11,7 +11,6 @@ import ( "path/filepath" "github.com/mattn/go-isatty" - "github.com/muesli/go-wordwrap" "github.com/rakyll/statik/fs" "github.com/spf13/cobra" @@ -138,6 +137,7 @@ func execute(cmd *cobra.Command, args []string) error { return err } } + r.WordWrap = int(width) u, err := url.ParseRequestURI(src.URL) if err == nil { @@ -146,7 +146,7 @@ func execute(cmd *cobra.Command, args []string) error { } out := r.RenderBytes(b) - fmt.Printf("%s", wordwrap.WrapString(string(out), width)) + fmt.Printf("%s", string(out)) return nil }