mirror of
https://github.com/charmbracelet/glow
synced 2025-01-18 15:04:03 +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"
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/mattn/go-isatty"
|
"github.com/mattn/go-isatty"
|
||||||
"github.com/muesli/go-wordwrap"
|
|
||||||
"github.com/rakyll/statik/fs"
|
"github.com/rakyll/statik/fs"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
|
@ -138,6 +137,7 @@ func execute(cmd *cobra.Command, args []string) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
r.WordWrap = int(width)
|
||||||
|
|
||||||
u, err := url.ParseRequestURI(src.URL)
|
u, err := url.ParseRequestURI(src.URL)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
@ -146,7 +146,7 @@ func execute(cmd *cobra.Command, args []string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
out := r.RenderBytes(b)
|
out := r.RenderBytes(b)
|
||||||
fmt.Printf("%s", wordwrap.WrapString(string(out), width))
|
fmt.Printf("%s", string(out))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue