From 6c759fa81d976d351eadde6e23ea231499495dc1 Mon Sep 17 00:00:00 2001 From: zeripath Date: Sat, 3 Dec 2022 15:47:00 +0000 Subject: [PATCH] Do not emit ambiguous character warning on rendered pages (#22016) Backport #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 --- 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 2b4f279cb6e36..ed2162a414f1e 100644 --- a/templates/repo/view_file.tmpl +++ b/templates/repo/view_file.tmpl @@ -79,7 +79,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}}