|
97 | 97 |
|
98 | 98 | re_simpleXmlTag=re.compile(r"\<[^>]+\>") |
99 | 99 |
|
| 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 | + |
100 | 105 | class JABTextInfo(textInfos.offsets.OffsetsTextInfo): |
101 | 106 |
|
102 | 107 | def _getOffsetFromPoint(self,x,y): |
@@ -274,7 +279,8 @@ def _get_keyboardShortcut(self): |
274 | 279 | return ", ".join(shortcutsList) |
275 | 280 |
|
276 | 281 | def _get_name(self): |
277 | | - return re_simpleXmlTag.sub(" ", self._JABAccContextInfo.name) |
| 282 | + name = self._JABAccContextInfo.name |
| 283 | + return _processHtml(name) |
278 | 284 |
|
279 | 285 | def _get_JABRole(self): |
280 | 286 | return self._JABAccContextInfo.role_en_US |
@@ -315,7 +321,8 @@ def _get_value(self): |
315 | 321 | return self.jabContext.getCurrentAccessibleValueFromContext() |
316 | 322 |
|
317 | 323 | def _get_description(self): |
318 | | - return re_simpleXmlTag.sub(" ", self._JABAccContextInfo.description) |
| 324 | + description = self._JABAccContextInfo.description |
| 325 | + return _processHtml(description) |
319 | 326 |
|
320 | 327 | def _get_location(self): |
321 | 328 | return RectLTWH(self._JABAccContextInfo.x,self._JABAccContextInfo.y,self._JABAccContextInfo.width,self._JABAccContextInfo.height) |
@@ -548,6 +555,7 @@ def event_gainFocus(self): |
548 | 555 | if activeDescendant: |
549 | 556 | eventHandler.queueEvent("gainFocus",activeDescendant) |
550 | 557 |
|
| 558 | + |
551 | 559 | class ComboBox(JAB): |
552 | 560 |
|
553 | 561 | def _get_states(self): |
|
0 commit comments