From 3d6d47102108d2448511c16f3353669b1fa15855 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 11 Nov 2022 11:08:48 +0000 Subject: [PATCH 1/4] Screen readers don't speak the # symbol --- content.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content.py b/content.py index 735281d38..0e0171364 100644 --- a/content.py +++ b/content.py @@ -684,8 +684,8 @@ def _add_hash_tags(word_str: str, http_prefix: str, domain: str, 'type': 'Hashtag' } replace_hashtags[word_str] = "#" + \ - hashtag + "" + "\" class=\"mention hashtag\" rel=\"tag\" tabindex=\"10\">" + \ + "#" + hashtag + "" return True From 99cf867ae15692a2e163850e96f2bf205e235195 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 11 Nov 2022 11:26:17 +0000 Subject: [PATCH 2/4] Screen readers don't announce hashes --- utils.py | 9 +++++++++ webapp_post.py | 3 +++ 2 files changed, 12 insertions(+) diff --git a/utils.py b/utils.py index 6f77922aa..31788e79f 100644 --- a/utils.py +++ b/utils.py @@ -3942,3 +3942,12 @@ def remove_square_capitals(text: str, system_language: str) -> str: else: result += chr(offset + text_value - start_value) return result + + +def dont_speak_hashtags(content: str) -> str: + """Ensure that hashtags aren't announced by screen readers + """ + if not content: + return content + return content.replace('>## Date: Fri, 11 Nov 2022 11:40:43 +0000 Subject: [PATCH 3/4] Use hidden --- content.py | 3 ++- utils.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/content.py b/content.py index 0e0171364..ff1535495 100644 --- a/content.py +++ b/content.py @@ -685,7 +685,8 @@ def _add_hash_tags(word_str: str, http_prefix: str, domain: str, } replace_hashtags[word_str] = "" + \ - "#" + hashtag + "" + "#" + \ + hashtag + "" return True diff --git a/utils.py b/utils.py index 31788e79f..93f953fc6 100644 --- a/utils.py +++ b/utils.py @@ -3950,4 +3950,4 @@ def dont_speak_hashtags(content: str) -> str: if not content: return content return content.replace('>## Date: Fri, 11 Nov 2022 12:13:15 +0000 Subject: [PATCH 4/4] Support multiple submit button names --- daemon.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/daemon.py b/daemon.py index b0c8a0b30..03e233ca2 100644 --- a/daemon.py +++ b/daemon.py @@ -19133,13 +19133,17 @@ class PubServer(BaseHTTPRequestHandler): not fields.get('pinToProfile'): print('WARN: no message, image description or pin') return -1 - submit_text = self.server.translate['Publish'] + submit_text1 = self.server.translate['Publish'] + submit_text2 = self.server.translate['Send'] + submit_text3 = submit_text2 custom_submit_text = \ get_config_param(self.server.base_dir, 'customSubmitText') if custom_submit_text: - submit_text = custom_submit_text + submit_text3 = custom_submit_text if fields.get('submitPost'): - if fields['submitPost'] != submit_text: + if fields['submitPost'] != submit_text1 and \ + fields['submitPost'] != submit_text2 and \ + fields['submitPost'] != submit_text3: print('WARN: no submit field ' + fields['submitPost']) return -1 else: