@@ -286,6 +286,7 @@ func renderReadmeFile(ctx *context.Context, subfolder string, readmeFile *git.Tr
286
286
287
287
ctx .Data ["FileIsText" ] = fInfo .isTextFile
288
288
ctx .Data ["FileName" ] = path .Join (subfolder , readmeFile .Name ())
289
+ ctx .Data ["FileSize" ] = fInfo .fileSize
289
290
ctx .Data ["IsLFSFile" ] = fInfo .isLFSFile
290
291
291
292
if fInfo .isLFSFile {
@@ -301,7 +302,6 @@ func renderReadmeFile(ctx *context.Context, subfolder string, readmeFile *git.Tr
301
302
// Pretend that this is a normal text file to display 'This file is too large to be shown'
302
303
ctx .Data ["IsFileTooLarge" ] = true
303
304
ctx .Data ["IsTextFile" ] = true
304
- ctx .Data ["FileSize" ] = fInfo .fileSize
305
305
return
306
306
}
307
307
@@ -552,7 +552,6 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry) {
552
552
} else {
553
553
ctx .Data ["NumLines" ] = bytes .Count (buf , []byte {'\n' }) + 1
554
554
}
555
- ctx .Data ["NumLinesSet" ] = true
556
555
557
556
language , err := files_service .TryGetContentLanguage (ctx .Repo .GitRepo , ctx .Repo .CommitID , ctx .Repo .TreePath )
558
557
if err != nil {
@@ -606,8 +605,8 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry) {
606
605
break
607
606
}
608
607
609
- // TODO: this logic seems strange, it duplicates with "isRepresentableAsText=true", it is not the same as "LFSFileGet" in "lfs.go"
610
- // maybe for this case, the file is a binary file, and shouldn't be rendered?
608
+ // TODO: this logic duplicates with "isRepresentableAsText=true", it is not the same as "LFSFileGet" in "lfs.go"
609
+ // It is used by "external renders", markupRender will execute external programs to get rendered content.
611
610
if markupType := markup .Type (blob .Name ()); markupType != "" {
612
611
rd := io .MultiReader (bytes .NewReader (buf ), dataRc )
613
612
ctx .Data ["IsMarkup" ] = true
0 commit comments