diff options
author | Jonas Franz <info@jonasfranz.software> | 2017-10-17 01:17:22 +0200 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2017-10-17 02:17:22 +0300 |
commit | f4190f8df869ce3031b705089fc9340c8d1862aa (patch) | |
tree | 1df74fa930cc3c2f090d9e4cebc48e7076920c84 /templates | |
parent | 33647aa43bc7e55f1c4c3f47caa6ecff9a738bfe (diff) | |
download | gitea-f4190f8df869ce3031b705089fc9340c8d1862aa.tar.gz gitea-f4190f8df869ce3031b705089fc9340c8d1862aa.zip |
Render plain text README.txt monospaced (#2721)
Signed-off-by: Jonas Franz <info@jonasfranz.software>
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo/view_file.tmpl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl index c68da4fae5..3bb2c13132 100644 --- a/templates/repo/view_file.tmpl +++ b/templates/repo/view_file.tmpl @@ -36,9 +36,11 @@ {{end}} </h4> <div class="ui attached table segment"> - <div class="file-view {{if .IsRenderedHTML}}markdown{{else if .IsTextFile}}code-view{{end}} has-emoji"> - {{if .IsRenderedHTML}} + <div class="file-view {{if .IsMarkup}}markdown{{else if .IsRenderedHTML}}plain-text{{else if .IsTextFile}}code-view{{end}} has-emoji"> + {{if .IsMarkup}} {{if .FileContent}}{{.FileContent | Str2html}}{{end}} + {{else if .IsRenderedHTML}} + <pre>{{if .FileContent}}{{.FileContent | Str2html}}{{end}}</pre> {{else if not .IsTextFile}} <div class="view-raw ui center"> {{if .IsImageFile}} |