From 21ed4fd8da4c8992518dcfb01aa7306f7406f735 Mon Sep 17 00:00:00 2001 From: zeripath Date: Fri, 7 Jan 2022 01:18:52 +0000 Subject: Add warning for BIDI characters in page renders and in diffs (#17562) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix #17514 Given the comments I've adjusted this somewhat. The numbers of characters detected are increased and include things like the use of U+300 to make à instead of à and non-breaking spaces. There is a button which can be used to escape the content to show it. Signed-off-by: Andrew Thornton Co-authored-by: Gwyneth Morgan Co-authored-by: silverwind Co-authored-by: wxiaoguang --- templates/repo/diff/box.tmpl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'templates/repo/diff/box.tmpl') diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index 3ab7a11bbd..f115a5f499 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -94,6 +94,10 @@ {{if $file.IsProtected}} {{$.i18n.Tr "repo.diff.protected"}} {{end}} + {{if not (or $file.IsIncomplete $file.IsBin $file.IsSubmodule)}} + {{$.i18n.Tr "repo.unescape_control_characters"}} + + {{end}} {{if and (not $file.IsSubmodule) (not $.PageIsWiki)}} {{if $file.IsDeleted}} {{$.i18n.Tr "repo.diff.view_file"}} @@ -104,7 +108,7 @@
-
+
{{if or $file.IsIncomplete $file.IsBin}}
{{if $file.IsIncomplete}} -- cgit v1.2.3