Skip to content

Commit 568b285

Browse files
authored
Merge 0d8ac55 into 14a9499
2 parents 14a9499 + 0d8ac55 commit 568b285

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

source/NVDAObjects/JAB/__init__.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@
9797

9898
re_simpleXmlTag=re.compile(r"\<[^>]+\>")
9999

100+
def _processHtml(text):
101+
""" Strips HTML tags from text if it is HTML """
102+
return re_simpleXmlTag.sub(" ", text) if text.startswith("<html>") else text
103+
104+
100105
class JABTextInfo(textInfos.offsets.OffsetsTextInfo):
101106

102107
def _getOffsetFromPoint(self,x,y):
@@ -274,7 +279,8 @@ def _get_keyboardShortcut(self):
274279
return ", ".join(shortcutsList)
275280

276281
def _get_name(self):
277-
return re_simpleXmlTag.sub(" ", self._JABAccContextInfo.name)
282+
name = self._JABAccContextInfo.name
283+
return _processHtml(name)
278284

279285
def _get_JABRole(self):
280286
return self._JABAccContextInfo.role_en_US
@@ -315,7 +321,8 @@ def _get_value(self):
315321
return self.jabContext.getCurrentAccessibleValueFromContext()
316322

317323
def _get_description(self):
318-
return re_simpleXmlTag.sub(" ", self._JABAccContextInfo.description)
324+
description = self._JABAccContextInfo.description
325+
return _processHtml(description)
319326

320327
def _get_location(self):
321328
return RectLTWH(self._JABAccContextInfo.x,self._JABAccContextInfo.y,self._JABAccContextInfo.width,self._JABAccContextInfo.height)
@@ -548,6 +555,7 @@ def event_gainFocus(self):
548555
if activeDescendant:
549556
eventHandler.queueEvent("gainFocus",activeDescendant)
550557

558+
551559
class ComboBox(JAB):
552560

553561
def _get_states(self):

0 commit comments

Comments
 (0)