summaryrefslogtreecommitdiffstats
path: root/modules/base
diff options
context:
space:
mode:
Diffstat (limited to 'modules/base')
-rw-r--r--modules/base/markdown.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/modules/base/markdown.go b/modules/base/markdown.go
index 540ee58f47..e59a6273ab 100644
--- a/modules/base/markdown.go
+++ b/modules/base/markdown.go
@@ -100,11 +100,20 @@ func (options *CustomRender) Link(out *bytes.Buffer, link []byte, title []byte,
}
func (options *CustomRender) Image(out *bytes.Buffer, link []byte, title []byte, alt []byte) {
+ prefix := strings.Replace(options.urlPrefix, "/src/", "/raw/", 1)
if len(link) > 0 && !isLink(link) {
- link = []byte(path.Join(strings.Replace(options.urlPrefix, "/src/", "/raw/", 1), string(link)))
+ if link[0] != '/' {
+ prefix += "/"
+ }
+ link = []byte(prefix + string(link))
}
+ fmt.Println(2, string(link))
+ out.WriteString(`<a href="`)
+ out.Write(link)
+ out.WriteString(`">`)
options.Renderer.Image(out, link, title, alt)
+ out.WriteString("</a>")
}
var (