mirror of
https://github.com/charmbracelet/glow.git
synced 2026-08-09 09:49:09 +02:00
Handle relative URLs in markdown, when a BaseURL is provided
This commit is contained in:
parent
5766f35363
commit
8eabf0f403
3 changed files with 29 additions and 16 deletions
|
|
@ -22,7 +22,7 @@ func isGitHubURL(s string) (string, bool) {
|
|||
}
|
||||
|
||||
// findGitHubREADME tries to find the correct README filename in a repository
|
||||
func findGitHubREADME(s string) (*http.Response, error) {
|
||||
func findGitHubREADME(s string) (*Source, error) {
|
||||
u, err := url.ParseRequestURI(s)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
@ -39,7 +39,7 @@ func findGitHubREADME(s string) (*http.Response, error) {
|
|||
}
|
||||
|
||||
if resp.StatusCode == http.StatusOK {
|
||||
return resp, nil
|
||||
return &Source{resp.Body, v.String()}, nil
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue