# MathJax removes any aria-label put on input mathml #502

Closed
opened this issue Jun 17, 2013 · 11 comments

Projects
None yet
5 participants

### jcayzac commented Jun 17, 2013

 I've noticed that MathJax 2.2 doesn't copy aria-label attributes from the input MathML to the span element it creates:  0 1 0 0 0 1 0 0 0 1  …becomes:  
Author

### jcayzac commented Jun 17, 2013

 Note: apparently it's the same for alttext attributes.
Contributor

### fred-wang commented Jun 27, 2013

 @jcayzac The HTML5 validator seems to say that aria-label is invalid on the math root, so you'd better put it on a parent span/div. alttext is preserved if you use the MathML output jax, but I don't know where you want MathJax to attach the attribute when SVG/HTML-CSS is used since alttext is a MathML attribute and is likely to be invalid on SVG/HTML elements. By default, the mml2jax preprocessor uses the altext as a preview: http://docs.mathjax.org/en/latest/options/mml2jax.html#the-mml2jax-preprocessor
Member

### pkra commented Jun 27, 2013

 That being said, I do think we should preserve aria and alttext -- much like we (soon) preserve annotation-xml. Perhaps we should ask the MathWG if aria might become valid?
Author

### jcayzac commented Aug 1, 2013

 My understanding is that the [itex] element in HTML5 is an HTML5 element with MathML content, not a MathML element (hence the lack of need to declare any namespace… also HTML5 is not XML), so HTML5 attributes would apply. Anyway, both MathML and SVG have their own mechanism for providing fallback content to screen readers, so it should be possible to map from one to the other.

Closed

### dpvc pushed a commit to dpvc/MathJax that referenced this issue Sep 14, 2014

 Preserve RDFa and other non-standard attributes from MathML elements … 
…in the HTML-CSS or SVG output. Resolves issue mathjax#860, and also handles mathjax#502 as a side-effect.
 ad004ac 
Member

### dpvc commented Sep 14, 2014

 The issue860 branch of my fork of MathJax addresses this issue. The SVG output now includes the aria-label from the [itex] element, if there was one, and data from the alttext attribute will be put into an aria-label attribute if there isn't an aria-label already.

Closed

Member

### dpvc commented Nov 13, 2014

 ==> Merged (Nov. 2 with issue 860)

### pkra added a commit to mathjax/MathJax-test that referenced this issue Jan 20, 2015

 add test for mathjax/MathJax#502 check that aria-label is preserved i… 
…n the output
 3bfb56e 

Member

### dpvc commented Jan 20, 2015

 ==> In Testsuite MathMLToDisplay/issue502.html

### b1tzmast3r commented Apr 29, 2015

 I noticed that the span MathJax_SVG has a role of math and the svg tag doesn't have a role attribute. Our tests have shown that putting role="img" on the svg tag will improve screen reader performance. Would you ever consider updating this? Current Rendering: 
Member

### pkra commented Apr 30, 2015

 @b1tzmast3r could you open a new issue to discuss this? Thanks!
Member

### pkra commented Apr 30, 2015

 FWIW, I don't think it should be img; graphic/diagram` seems more fitting but we'll have to do some research.

### b1tzmast3r commented May 11, 2015

 I've started a new issue for this: #1192 Sorry for the delay...