mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-29 10:57:44 +09:00 
			
		
		
		
	display large file
This commit is contained in:
		| @@ -176,9 +176,10 @@ func Single(ctx *middleware.Context, params martini.Params) { | ||||
| 			_, isImageFile := base.IsImageFile(buf) | ||||
| 			ctx.Data["FileIsText"] = isTextFile | ||||
|  | ||||
| 			if isImageFile { | ||||
| 			switch { | ||||
| 			case isImageFile: | ||||
| 				ctx.Data["IsImageFile"] = true | ||||
| 			} else { | ||||
| 			case isTextFile: | ||||
| 				d, _ := ioutil.ReadAll(dataRc) | ||||
| 				buf = append(buf, d...) | ||||
| 				readmeExist := base.IsMarkdownFile(blob.Name()) || base.IsReadmeFile(blob.Name()) | ||||
| @@ -186,9 +187,7 @@ func Single(ctx *middleware.Context, params martini.Params) { | ||||
| 				if readmeExist { | ||||
| 					ctx.Data["FileContent"] = string(base.RenderMarkdown(buf, "")) | ||||
| 				} else { | ||||
| 					if isTextFile { | ||||
| 						ctx.Data["FileContent"] = string(buf) | ||||
| 					} | ||||
| 					ctx.Data["FileContent"] = string(buf) | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user