File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -531,7 +531,7 @@ const Util = exports.Util = {
531531 //
532532 if ( ( ! args [ 'include-latex' ] && ( name == 'data-latex' || name === 'data-latex-item' ) ) ||
533533 ( ! args . semantics &&
534- name . match ( / ^ (?: d a t a - s e m a n t i c - .* | d a t a - s p e e c h - n o d e | d a t a - (?: s p e e c h | b r a i l l e ) - a t t a c h e d | a r i a - l e v e l ) $ / ) ) ) {
534+ name . match ( / ^ (?: d a t a - s e m a n t i c - .* | d a t a - s p e e c h - n o d e | d a t a - (?: s p e e c h | b r a i l l e ) - a t t a c h e d ) $ / ) ) ) {
535535 adaptor . removeAttribute ( node , name ) ;
536536 }
537537 }
@@ -557,9 +557,13 @@ const Util = exports.Util = {
557557 if ( ! args . _speech && ! args . _braille ) return ;
558558 if ( args . _speech ) {
559559 adaptor . setAttribute ( node , 'aria-label' , args . _speech ) ;
560+ adaptor . setAttribute ( node , 'role' , 'img' ) ;
561+ adaptor . setAttribute ( node , 'aria-roledescription' , '\u0091' ) ; // not spoken by screen readers
560562 }
561563 if ( args . _braille ) {
562564 adaptor . setAttribute ( node , 'aria-braillelabel' , args . _braille ) ;
565+ adaptor . setAttribute ( node , 'role' , 'img' ) ;
566+ adaptor . setAttribute ( node , 'aria-brailleroledescription' , 'math' ) ;
563567 }
564568 //
565569 // For SVG, find the math node, for CHTML use all children,
Original file line number Diff line number Diff line change @@ -530,7 +530,7 @@ export const Util = {
530530 //
531531 if ( ( ! args [ 'include-latex' ] && ( name == 'data-latex' || name === 'data-latex-item' ) ) ||
532532 ( ! args . semantics &&
533- name . match ( / ^ (?: d a t a - s e m a n t i c - .* | d a t a - s p e e c h - n o d e | d a t a - (?: s p e e c h | b r a i l l e ) - a t t a c h e d | a r i a - l e v e l ) $ / ) ) ) {
533+ name . match ( / ^ (?: d a t a - s e m a n t i c - .* | d a t a - s p e e c h - n o d e | d a t a - (?: s p e e c h | b r a i l l e ) - a t t a c h e d ) $ / ) ) ) {
534534 adaptor . removeAttribute ( node , name ) ;
535535 }
536536 }
@@ -556,9 +556,13 @@ export const Util = {
556556 if ( ! args . _speech && ! args . _braille ) return ;
557557 if ( args . _speech ) {
558558 adaptor . setAttribute ( node , 'aria-label' , args . _speech ) ;
559+ adaptor . setAttribute ( node , 'role' , 'img' ) ;
560+ adaptor . setAttribute ( node , 'aria-roledescription' , '\u0091' ) ; // not spoken by screen readers
559561 }
560562 if ( args . _braille ) {
561563 adaptor . setAttribute ( node , 'aria-braillelabel' , args . _braille ) ;
564+ adaptor . setAttribute ( node , 'role' , 'img' ) ;
565+ adaptor . setAttribute ( node , 'aria-brailleroledescription' , 'math' ) ;
562566 }
563567 //
564568 // For SVG, find the math node, for CHTML use all children,
You can’t perform that action at this time.
0 commit comments