Skip to content

Commit a63f14b

Browse files
authored
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 <[email protected]>
1 parent a19d2bb commit a63f14b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

templates/repo/view_list.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,6 @@
6868
{{end}}
6969
</tbody>
7070
</table>
71-
{{if .ReadmeExist}}
71+
{{if and .ReadmeExist (or .IsMarkup .IsPlainText)}}
7272
{{template "repo/view_file" .}}
7373
{{end}}

0 commit comments

Comments
 (0)