- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 6.2k
 
Closed
Labels
type/enhancementAn improvement of existing functionalityAn improvement of existing functionalitytype/proposalThe new feature has not been accepted yet but needs to be discussed first.The new feature has not been accepted yet but needs to be discussed first.
Description
- Gitea version (or commit ref): 1.4.3
 - Git version: 2.18.0
 - Operating system: FreeBSD 11.2-RELEASE
 - Database (use 
[x]):- PostgreSQL
 - MySQL
 - MSSQL
 - SQLite
 
 - Can you reproduce the bug at https://try.gitea.io:
- Yes (provide example URL)
 - No
 - Not relevant
 
 - Log gist:
 
Description
Currently, files are only checked against external markup extensions when the file is a text file:
Lines 201 to 214 in fc0001c
| case isTextFile: | |
| if blob.Size() >= setting.UI.MaxDisplayFileSize { | |
| ctx.Data["IsFileTooLarge"] = true | |
| break | |
| } | |
| d, _ := ioutil.ReadAll(dataRc) | |
| buf = templates.ToUTF8WithFallback(append(buf, d...)) | |
| readmeExist := markup.IsReadmeFile(blob.Name()) | |
| ctx.Data["ReadmeExist"] = readmeExist | |
| if markup.Type(blob.Name()) != "" { | |
| ctx.Data["IsMarkup"] = true | |
| ctx.Data["FileContent"] = string(markup.Render(blob.Name(), buf, path.Dir(treeLink), ctx.Repo.Repository.ComposeMetas())) | 
I would like to be able to use external markup renderers to render previews of some binary formats, similar to how PDFs can be displayed inline. Instead, I always get the "view raw" page for binary files.
Metadata
Metadata
Assignees
Labels
type/enhancementAn improvement of existing functionalityAn improvement of existing functionalitytype/proposalThe new feature has not been accepted yet but needs to be discussed first.The new feature has not been accepted yet but needs to be discussed first.