|
|
|
@ -7,7 +7,6 @@ import ( |
|
|
|
|
"io" |
|
|
|
|
"net/url" |
|
|
|
|
"path" |
|
|
|
|
"path/filepath" |
|
|
|
|
"regexp" |
|
|
|
|
"strings" |
|
|
|
|
) |
|
|
|
@ -50,11 +49,10 @@ func GemtextToMarkdown(dst io.Writer, src io.Reader, gmiGateway *url.URL) error |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if u.Scheme == "gemini" && gmiGateway != nil { |
|
|
|
|
|
|
|
|
|
newU := *gmiGateway |
|
|
|
|
newU.Path = filepath.Join(newU.Path, u.Host, u.Path) |
|
|
|
|
newU.RawQuery = u.RawQuery |
|
|
|
|
u = &newU |
|
|
|
|
newUStr := gmiGateway.String() + u.Host + u.Path |
|
|
|
|
if u, err = url.Parse(newUStr); err != nil { |
|
|
|
|
return fmt.Errorf("parsing proxied URL %q: %w", newUStr, err) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
isImg := hasImgExt(u.Path) |
|
|
|
|