mathjax / mathjax/MathJax

alttext value default aria-label value when present

Open
#2,849 9 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Code Example Feature Request Good first contribution v3
Dominant language
JavaScript
Stars
10.9k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

MathJax v3.2.0 does not render the alttext attribute value provided to the MathML object as the default (accessible) aria-label.

I have observed that MathJax v2.7.9 worked in this manner and was a good feature at the time.

There are situations when the alttext attribute value can provide clear language to students than MathML markup alone could provide. For example terms like “in equilibrium with…the coefficient...molar concentration of…” applied via the alttext attribute would be more meaningful than "right facing arrow over left facing arrow" when left to automated MathSpeak generation alone.

<math displaystyle="true" xmlns="http://www.w3.org/1998/Math/MathML" alttext="K sub c, equals the fraction with numerator, the molar concentration of uppercase C raised to the lowercase c, times, the molar concentration of uppercase D raised to the lowercase d, and denominator, the molar concentration of uppercase A raised to the lowercase a, times, the molar concentration of uppercase B raised to the lowercase b, where the coefficient, lowercase a before uppercase A, plus, the coefficient lowercase b before uppercase B is in equilibrium with the coefficient, lowercase c before uppercase C, plus, the coefficient lowercase d before uppercase D">...</math>

I propose that when alttext is present within the mathml element MathJax utilizes this as the default aria-label. When the alttext attribute is not present, then users would rely on the default automated MathSpeak generated aria-label.

If a situation occurs where the alttext is not sufficient, users could be given a (new) menu option like "MathML alttext" to choose from along with MathSpeak, ClearSpeak and other options that are currently offered through accessibility menu options.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating MathML accessibility processing in the MathJax v3.2.0 code and the path that generates the default MathSpeak aria-label. Compare that behavior with MathJax v2.7.9, then verify that a present MathML alttext is used by default while absent alttext retains automated speech generation; any menu option would require separate scope review.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
accessibility
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.