@@ -286,6 +286,7 @@ func renderReadmeFile(ctx *context.Context, subfolder string, readmeFile *git.Tr
286286
287287 ctx .Data ["FileIsText" ] = fInfo .isTextFile
288288 ctx .Data ["FileName" ] = path .Join (subfolder , readmeFile .Name ())
289+ ctx .Data ["FileSize" ] = fInfo .fileSize
289290 ctx .Data ["IsLFSFile" ] = fInfo .isLFSFile
290291
291292 if fInfo .isLFSFile {
@@ -301,7 +302,6 @@ func renderReadmeFile(ctx *context.Context, subfolder string, readmeFile *git.Tr
301302 // Pretend that this is a normal text file to display 'This file is too large to be shown'
302303 ctx .Data ["IsFileTooLarge" ] = true
303304 ctx .Data ["IsTextFile" ] = true
304- ctx .Data ["FileSize" ] = fInfo .fileSize
305305 return
306306 }
307307
@@ -552,7 +552,6 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry) {
552552 } else {
553553 ctx .Data ["NumLines" ] = bytes .Count (buf , []byte {'\n' }) + 1
554554 }
555- ctx .Data ["NumLinesSet" ] = true
556555
557556 language , err := files_service .TryGetContentLanguage (ctx .Repo .GitRepo , ctx .Repo .CommitID , ctx .Repo .TreePath )
558557 if err != nil {
@@ -606,8 +605,8 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry) {
606605 break
607606 }
608607
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.
611610 if markupType := markup .Type (blob .Name ()); markupType != "" {
612611 rd := io .MultiReader (bytes .NewReader (buf ), dataRc )
613612 ctx .Data ["IsMarkup" ] = true
0 commit comments