Skip to content

Commit eaf8b84

Browse files
Merge 2c6988f into cda7eed
2 parents cda7eed + 2c6988f commit eaf8b84

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

source/NVDAObjects/IAccessible/adobeAcrobat.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,19 @@ def _getNodeMathMl(self, node: IPDDomElement) -> str:
171171

172172
def _get_mathMl(self) -> str:
173173
"""Return the MathML associated with a Formula tag"""
174-
# There are two ways that MathML can be represented in a PDF:
174+
# There are three ways that MathML can be represented in a PDF:
175175
# 1. As a series of nested tags, each with a MathML element as the value.
176176
# 2. As a Formula tag with MathML as the value (comes from MathML in an Associated File)
177+
# 3. As a custom Microsoft Office attribute (MSFT_MathML) on the Formula tag.
177178
if self.pdDomNode is None:
178179
log.debugWarning("_get_mathMl: self.pdDomNode is None!")
179180
raise LookupError
180181

182+
# First, fetch and return the MSFT_MathML attribute if it exists.
183+
math = self.pdDomNode.GetAttribute("MSFT_MathML", "MSFT_Office")
184+
if math:
185+
return math
186+
181187
# see if it is MathML tagging is used
182188
for childNum in range(self.pdDomNode.GetChildCount()):
183189
try:

user_docs/en/changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ Please responsibly disclose security issues following NVDA's [security policy](h
8585
* Added a general setting to prevent the display turning off during say all or reading with braille.
8686
This option is enabled by default, but may result in increased battery depletion. (#17649@LeonarddeR)
8787
* NVDA is now translated into Bosnian. (#17953)
88+
* In Adobe Acrobat, NVDA can now read and interact with math equations in PDF documents generated by recent versions of Microsoft Word. (#18056)
8889

8990
### Changes
9091

0 commit comments

Comments
 (0)