mirror of
https://github.com/charmbracelet/glow
synced 2024-11-10 06:04:18 +00:00
Fix init when reading from stdin
This commit is contained in:
parent
6ab640709c
commit
f090b74c60
1 changed files with 3 additions and 1 deletions
4
main.go
4
main.go
|
@ -122,13 +122,15 @@ func execute(cmd *cobra.Command, args []string) error {
|
|||
style = "notty"
|
||||
}
|
||||
|
||||
var baseURL string
|
||||
u, err := url.ParseRequestURI(src.URL)
|
||||
if err == nil {
|
||||
u.Path = filepath.Dir(u.Path)
|
||||
baseURL = u.String() + "/"
|
||||
}
|
||||
|
||||
r, err := glamour.NewTermRenderer(style, ansi.Options{
|
||||
BaseURL: u.String() + "/",
|
||||
BaseURL: baseURL,
|
||||
WordWrap: int(width),
|
||||
})
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in a new issue