Skip to content

Commit 821caef

Browse files
committed
fix commit url
1 parent 40a8a08 commit 821caef

File tree

1 file changed

+3
-4
lines changed
  • src/main/resources/embedding/assets

1 file changed

+3
-4
lines changed

src/main/resources/embedding/assets/entry.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@ $(function(){
2323
return url.replace("/blob/", "/raw/");
2424
};
2525

26-
function getCommitUrl(x){
27-
let url = x[0]
26+
function getCommitUrl(url, filename){
2827
url = url.replace("/blob/", "/commit/")
29-
reg = new RegExp('/' + x[4] + '#L\\d+(-L\\d+)?$')
28+
reg = new RegExp('/' + filename + '#L\\d+(-L\\d+)?$')
3029
return url.replace(reg, "")
3130
};
3231

@@ -65,7 +64,7 @@ $(function(){
6564
if(typeof mat[7] !== "undefined"){
6665
endLine = Number(mat[7].replace("-L", ""));
6766
};
68-
let commitUrl = getCommitUrl(mat)
67+
let commitUrl = getCommitUrl(url, filename)
6968
try{
7069
let content = getContent(url);
7170
let linesAll = content.split("\n");

0 commit comments

Comments
 (0)