diff --git a/config.go b/config.go index aa8ca70..5d26292 100644 --- a/config.go +++ b/config.go @@ -1,4 +1,4 @@ -package gmitohtml +package main import ( "crypto/tls" diff --git a/pkg/gmitohtml/convert.go b/pkg/gmitohtml/convert.go index 59588be..fcaf208 100644 --- a/pkg/gmitohtml/convert.go +++ b/pkg/gmitohtml/convert.go @@ -128,7 +128,6 @@ func Convert(page []byte, u string) []byte { linkLabel = line[splitStart:] } - // If link ends with gif/png/jpg, add a image instead of a link parts := strings.Split(string(linkURL), ".") extension := parts[len(parts)-1] isImage := false @@ -138,19 +137,14 @@ func Convert(page []byte, u string) []byte { } } + uri := html.EscapeString(rewriteURL(string(linkURL), parsedURL)) + title := html.EscapeString(string(linkLabel)) + + // If link ends with gif/png/jpg, add a image instead of a link if isImage && Config.ConvertImages { - img := append([]byte(``)...)
-				img = append(img, html.EscapeString(string(linkLabel))...)
-				img = append(img, []byte(``)...) - result = append(result, img...) + result = append(result, []byte("\""")...) } else { - link := append([]byte(``)...) - link = append(link, html.EscapeString(string(linkLabel))...) - link = append(link, []byte(``)...) - result = append(result, link...) - result = append(result, []byte("
")...) + result = append(result, []byte("" + title + "
")...) } continue