mirror of
https://github.com/gogs/gogs.git
synced 2025-05-29 18:53:42 +00:00
repo: improve relative path detection (#4366)
This commit is contained in:
parent
455dc072ba
commit
c210984b40
@ -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}"`
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user