diff options
author | zeripath <art27@cantab.net> | 2022-12-03 15:47:00 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-03 23:47:00 +0800 |
commit | 0e46499258a20a8d701cdfc489c55a4246b4901e (patch) | |
tree | 4824cb0bf20f2cc0e8d11abf4724e42a4c7a4e14 | |
parent | 181f4bfdb1a71f06e734d3c881b648f5eaaa1317 (diff) | |
download | gitea-0e46499258a20a8d701cdfc489c55a4246b4901e.tar.gz gitea-0e46499258a20a8d701cdfc489c55a4246b4901e.zip |
Do not emit ambiguous character warning on rendered pages (#22016)
The real sensitivity of ambiguous characters is in source code -
therefore warning about them in rendered pages causes too many warnings.
Therefore simply remove the warning on rendered pages.
The escape button will remain available and it is present on the view
source page.
Fix #20999
Signed-off-by: Andrew Thornton <art27@cantab.net>
-rw-r--r-- | templates/repo/view_file.tmpl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl index 0fe0a13198..9d82cc018c 100644 --- a/templates/repo/view_file.tmpl +++ b/templates/repo/view_file.tmpl @@ -58,7 +58,9 @@ </div> </h4> <div class="ui attached table unstackable segment"> - {{template "repo/unicode_escape_prompt" dict "EscapeStatus" .EscapeStatus "root" $}} + {{if not (or .IsMarkup .IsRenderedHTML)}} + {{template "repo/unicode_escape_prompt" dict "EscapeStatus" .EscapeStatus "root" $}} + {{end}} <div class="file-view{{if .IsMarkup}} markup {{.MarkupType}}{{else if .IsRenderedHTML}} plain-text{{else if .IsTextSource}} code-view{{end}}"> {{if .IsMarkup}} {{if .FileContent}}{{.FileContent | Safe}}{{end}} |