From 32abe0d09992277b16b29ff54a3411b7fb5ba1af Mon Sep 17 00:00:00 2001 From: Andrew Thornton Date: Sat, 3 Dec 2022 14:12:46 +0000 Subject: [PATCH] Do not emit ambiguous character warning on rendered pages 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 --- templates/repo/view_file.tmpl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl index 0fe0a131985dd..9d82cc018c792 100644 --- a/templates/repo/view_file.tmpl +++ b/templates/repo/view_file.tmpl @@ -58,7 +58,9 @@
- {{template "repo/unicode_escape_prompt" dict "EscapeStatus" .EscapeStatus "root" $}} + {{if not (or .IsMarkup .IsRenderedHTML)}} + {{template "repo/unicode_escape_prompt" dict "EscapeStatus" .EscapeStatus "root" $}} + {{end}}
{{if .IsMarkup}} {{if .FileContent}}{{.FileContent | Safe}}{{end}}