Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix no speech when role="math" on a non-math element (#17327)
This fixes #15058. Summary of the issue: When someone has something like <span role="math"> <math> <msqrt> <mn>4</mn> </msqrt> </math> </span> The math is not spoken (nothing is spoken). This construct happens in real life math (see #15058 for more details). Description of user facing changes Web content such as the above will now be spoken as if the span (or other elements) are not present. This is what should have always happened. Description of development approach The fix (which is a bit of a hueristic) is to look inside the span (or other element with role="math" and see if exactly one of the children is math. If so, then we recursively call the code to get the MathML for it. If there isn't exactly one math element, we fall through and raise a LookupError (which is what happened before adding this check).
- Loading branch information