Fix to case where alt text for math in PDF contains & and <#18135
Merged
Conversation
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. |
SaschaCowley
previously requested changes
May 20, 2025
fix typo in comment Co-authored-by: Sascha Cowley <16543535+SaschaCowley@users.noreply.github.com>
Contributor
Author
|
Do I need to add something to the change log? |
seanbudd
approved these changes
May 22, 2025
& and ^& and <
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
<-><and&->&(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:
@coderabbitai summary