Fix view of readme file in the home code page. (#30564)

Gitea attempts to display image file, pdf file, etc. named readme in the
home code page (but it cannot).
I think only the markdown and plain-text file should be displayed, which
is also the behavior of GitHub.

Co-authored-by: jxshin <zhujiaxinabc@gmail.com>
This commit is contained in:
Jiaxin Zhu 2024-04-25 08:07:38 +08:00 committed by GitHub
parent a19d2bbd90
commit a63f14b908
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -68,6 +68,6 @@
{{end}}
</tbody>
</table>
{{if .ReadmeExist}}
{{if and .ReadmeExist (or .IsMarkup .IsPlainText)}}
{{template "repo/view_file" .}}
{{end}}