repo: improve relative path detection (#4366)

pull/4551/head
Unknwon 2017-06-06 16:06:28 -04:00
parent 455dc072ba
commit c210984b40
No known key found for this signature in database
GPG Key ID: 7A02C406FAC875A2
1 changed files with 2 additions and 1 deletions

View File

@ -53,7 +53,8 @@
// Overwrite image method to append proper prefix to the source URL
var renderer = new marked.Renderer();
var context = '{{.BranchLink}}'.replace('/src/', '/raw/');
var context = '{{.RawFileLink}}';
context = context.substring(0, context.lastIndexOf("/"));
renderer.image = function (href, title, text) {
return `<img src="${context}/${href}"`
}