wp/wp-includes/js/wp-a11y.js
changeset 9 177826044cd9
parent 7 cf61fcea0001
equal deleted inserted replaced
8:c7c34916027a 9:177826044cd9
       
     1 /**
       
     2  * @output wp-includes/js/wp-a11y.js
       
     3  */
       
     4 
     1 /** @namespace wp */
     5 /** @namespace wp */
     2 window.wp = window.wp || {};
     6 window.wp = window.wp || {};
     3 
     7 
     4 ( function ( wp, $ ) {
     8 ( function ( wp, $ ) {
     5 	'use strict';
     9 	'use strict';
    21 	 */
    25 	 */
    22 	function speak( message, ariaLive ) {
    26 	function speak( message, ariaLive ) {
    23 		// Clear previous messages to allow repeated strings being read out.
    27 		// Clear previous messages to allow repeated strings being read out.
    24 		clear();
    28 		clear();
    25 
    29 
    26 		// Ensure only text is sent to screen readers.
    30 		// Remove HTML tags, ensuring only text is sent to screen readers.
    27 		message = $( '<p>' ).html( message ).text();
    31 		message = wp.sanitize.stripTagsAndEncodeText( message );
    28 
    32 
    29 		/*
    33 		/*
    30 		 * Safari 10+VoiceOver don't announce repeated, identical strings. We use
    34 		 * Safari 10+VoiceOver don't announce repeated, identical strings. We use
    31 		 * a `no-break space` to force them to think identical strings are different.
    35 		 * a `no-break space` to force them to think identical strings are different.
    32 		 * See ticket #36853.
    36 		 * See ticket #36853.