From b7530016871bd4e02148b39415345e236642dc45 Mon Sep 17 00:00:00 2001 From: "Panagiotis \"Ivory\" Vasilopoulos" Date: Sun, 4 Jun 2023 14:35:32 +0200 Subject: [PATCH 1/4] Make confusable character warning less jarring This commit assumes that the warning can be made more discreet so as to make it less annoying for the people that do not actually need the warning, without necessarily increasing the risk for those that do need it. This doesn't fix the underlying problem of the warning being shown in certain cases that, say, a certain kind of whitespace character like 0x1E could be absolutely justifiable from a technical perspective. --- options/locale/locale_en-US.ini | 8 ++++---- templates/repo/unicode_escape_prompt.tmpl | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 517d829c84bf7..e8dff3ac8fea9 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -1131,10 +1131,10 @@ file_view_rendered = View Rendered file_view_raw = View Raw file_permalink = Permalink file_too_large = The file is too large to be shown. -invisible_runes_header = `This file contains invisible Unicode characters!` -invisible_runes_description = `This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.` -ambiguous_runes_header = `This file contains ambiguous Unicode characters!` -ambiguous_runes_description = `This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.` +invisible_runes_header = `This file contains invisible Unicode characters` +invisible_runes_description = `This file contains different kinds of invisible Unicode characters that are indistinguishable to humans, but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.` +ambiguous_runes_header = `This file contains ambiguous Unicode characters` +ambiguous_runes_description = `This file contains ambiguous Unicode characters that could possibly be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.` invisible_runes_line = `This line has invisible unicode characters` ambiguous_runes_line = `This line has ambiguous unicode characters` ambiguous_character = `%[1]c [U+%04[1]X] can be confused with %[2]c [U+%04[2]X]` diff --git a/templates/repo/unicode_escape_prompt.tmpl b/templates/repo/unicode_escape_prompt.tmpl index 12eff6aebe3af..bfc30209956aa 100644 --- a/templates/repo/unicode_escape_prompt.tmpl +++ b/templates/repo/unicode_escape_prompt.tmpl @@ -1,6 +1,6 @@ {{if .EscapeStatus}} {{if .EscapeStatus.HasInvisible}} -
+
{{$.root.locale.Tr "repo.invisible_runes_header"}} @@ -11,7 +11,7 @@ {{end}}
{{else if .EscapeStatus.HasAmbiguous}} -
+
{{$.root.locale.Tr "repo.ambiguous_runes_header"}} From ab797a414c34eec506fde4f093c29e4df603c024 Mon Sep 17 00:00:00 2001 From: "Panagiotis \"Ivory\" Vasilopoulos" Date: Sun, 25 Jun 2023 14:46:39 +0000 Subject: [PATCH 2/4] Update options/locale/locale_en-US.ini Co-authored-by: delvh --- options/locale/locale_en-US.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index e8dff3ac8fea9..7c74a08ad42f3 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -1132,7 +1132,7 @@ file_view_raw = View Raw file_permalink = Permalink file_too_large = The file is too large to be shown. invisible_runes_header = `This file contains invisible Unicode characters` -invisible_runes_description = `This file contains different kinds of invisible Unicode characters that are indistinguishable to humans, but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.` +invisible_runes_description = `This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.` ambiguous_runes_header = `This file contains ambiguous Unicode characters` ambiguous_runes_description = `This file contains ambiguous Unicode characters that could possibly be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.` invisible_runes_line = `This line has invisible unicode characters` From c943a36da8f1ed0fa0d79e4bb7afa4099a9e3f56 Mon Sep 17 00:00:00 2001 From: "Panagiotis \"Ivory\" Vasilopoulos" Date: Sun, 25 Jun 2023 14:46:48 +0000 Subject: [PATCH 3/4] Update options/locale/locale_en-US.ini Co-authored-by: delvh --- options/locale/locale_en-US.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 7c74a08ad42f3..c4862e8c4b271 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -1134,7 +1134,7 @@ file_too_large = The file is too large to be shown. invisible_runes_header = `This file contains invisible Unicode characters` invisible_runes_description = `This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.` ambiguous_runes_header = `This file contains ambiguous Unicode characters` -ambiguous_runes_description = `This file contains ambiguous Unicode characters that could possibly be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.` +ambiguous_runes_description = `This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.` invisible_runes_line = `This line has invisible unicode characters` ambiguous_runes_line = `This line has ambiguous unicode characters` ambiguous_character = `%[1]c [U+%04[1]X] can be confused with %[2]c [U+%04[2]X]` From d2d498c49c1ac1584c0c15bd5528ebbbc203afe5 Mon Sep 17 00:00:00 2001 From: "Panagiotis \"Ivory\" Vasilopoulos" Date: Wed, 2 Aug 2023 18:32:25 +0200 Subject: [PATCH 4/4] Use warning attribute --- templates/repo/unicode_escape_prompt.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/repo/unicode_escape_prompt.tmpl b/templates/repo/unicode_escape_prompt.tmpl index bfc30209956aa..d1e30396a1e01 100644 --- a/templates/repo/unicode_escape_prompt.tmpl +++ b/templates/repo/unicode_escape_prompt.tmpl @@ -1,6 +1,6 @@ {{if .EscapeStatus}} {{if .EscapeStatus.HasInvisible}} -
+
{{$.root.locale.Tr "repo.invisible_runes_header"}} @@ -11,7 +11,7 @@ {{end}}
{{else if .EscapeStatus.HasAmbiguous}} -
+
{{$.root.locale.Tr "repo.ambiguous_runes_header"}}