Skip to content

Fix to case where alt text for math in PDF contains & and <#18135

Merged
seanbudd merged 5 commits into
nvaccess:betafrom
NSoiffer:beta
May 22, 2025
Merged

Fix to case where alt text for math in PDF contains & and <#18135
seanbudd merged 5 commits into
nvaccess:betafrom
NSoiffer:beta

Conversation

@NSoiffer

@NSoiffer NSoiffer commented May 20, 2025

Copy link
Copy Markdown
Contributor

Link to issue number:

Fixes #18133

Summary of the issue:

In #17276, support was added for alt text in a formula (a fallback when MathML is not detected) by wrapping the alt text inside of MathML's mtext tag. That text might have < and & characters which should be "escaped" but were not.

The PDF support was added to 2025.1 beta.

The fix is trivial: < -> &lt; and & -> &amp; (in that order).

In #18133 I said that the punctuation was not being spoken, but it turns out that MathCAT actually does convert the punctuation in strings, so LaTeX is spoken sensibly (but it is still hard to understand when read quickly).

Description of user facing changes

In Adobe Acrobat, NVDA now properly reads alt text inside of Formula tags when no MathML is present (in various forms).

Description of development approach

Simple string replace() calls to do the substitutions.

Testing strategy:

I opened the test file alt.pdf and listened what it said. I checked that in the speech viewer.

Known issues with pull request:

None

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

@coderabbitai summary

@NSoiffer

Copy link
Copy Markdown
Contributor Author

I did not add an entry to the change log because this is a fix to something that was added but not in a full release. Hence, it really isn't a bug fix for 2025.1. Let me know if I should add a line to the change log.

Comment thread source/NVDAObjects/IAccessible/adobeAcrobat.py Outdated
Comment thread source/NVDAObjects/IAccessible/adobeAcrobat.py Outdated
fix typo in comment

Co-authored-by: Sascha Cowley <16543535+SaschaCowley@users.noreply.github.com>
@seanbudd seanbudd added this to the 2025.1 milestone May 21, 2025
@NSoiffer

Copy link
Copy Markdown
Contributor Author

Do I need to add something to the change log?

@NSoiffer NSoiffer requested a review from SaschaCowley May 21, 2025 23:41
@seanbudd seanbudd marked this pull request as ready for review May 22, 2025 01:07
@seanbudd seanbudd requested a review from a team as a code owner May 22, 2025 01:07
Comment thread source/NVDAObjects/IAccessible/adobeAcrobat.py Outdated
@NSoiffer NSoiffer changed the title Fix to case where alt text for math in PDF contains & and ^ Fix to case where alt text for math in PDF contains & and < May 22, 2025
@seanbudd seanbudd merged commit f50f75b into nvaccess:beta May 22, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants