[orca] Eliminate false positive identifying broken text support
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Eliminate false positive identifying broken text support
- Date: Fri, 24 Jan 2020 22:44:41 +0000 (UTC)
commit 642e9a8631eef1e6c6fa8618130a6c4ace01f781
Author: Joanmarie Diggs <joanmarie diggs gmail com>
Date: Fri Jan 24 17:42:06 2020 -0500
Eliminate false positive identifying broken text support
If all the text consists of embedded objects separated by newline chars,
we shouldn't flag it as broken text (with one word per line) which should
be presented as a single object.
src/orca/scripts/web/script_utilities.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index 6229b682c..ccd048ee1 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -2800,10 +2800,11 @@ class Utilities(script_utilities.Utilities):
debug.println(debug.LEVEL_INFO, msg, True)
return False
+ tokens = list(filter(lambda x: x, re.split(r"[\s\ufffc]", text.getText(0, -1))))
+
# Note: We cannot check for the editable-text interface, because Gecko
# seems to be exposing that for non-editable things. Thanks Gecko.
- rv = not state.contains(pyatspi.STATE_EDITABLE) \
- and len(text.getText(0, -1).split()) > 1
+ rv = not state.contains(pyatspi.STATE_EDITABLE) and len(tokens) > 1
if rv:
boundary = pyatspi.TEXT_BOUNDARY_LINE_START
i = 0
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]