mirror of
https://github.com/charmbracelet/glow
synced 2024-12-15 06:22:36 +00:00
Render each paragraph individually and reflow text only inside paragraphs
This commit is contained in:
parent
5fe7e94483
commit
d6c1b7fa73
1 changed files with 2 additions and 2 deletions
4
main.go
4
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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue