فهرست منبع

repo: improve relative path detection (#4366)

Unknwon 7 سال پیش
والد
کامیت
c210984b40
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      templates/repo/view_file.tmpl

+ 2 - 1
templates/repo/view_file.tmpl

@@ -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}"`
 						}