wp/wp-includes/js/wp-a11y.js
changeset 9 177826044cd9
parent 7 cf61fcea0001
--- a/wp/wp-includes/js/wp-a11y.js	Mon Oct 14 18:06:33 2019 +0200
+++ b/wp/wp-includes/js/wp-a11y.js	Mon Oct 14 18:28:13 2019 +0200
@@ -1,3 +1,7 @@
+/**
+ * @output wp-includes/js/wp-a11y.js
+ */
+
 /** @namespace wp */
 window.wp = window.wp || {};
 
@@ -23,8 +27,8 @@
 		// Clear previous messages to allow repeated strings being read out.
 		clear();
 
-		// Ensure only text is sent to screen readers.
-		message = $( '<p>' ).html( message ).text();
+		// Remove HTML tags, ensuring only text is sent to screen readers.
+		message = wp.sanitize.stripTagsAndEncodeText( message );
 
 		/*
 		 * Safari 10+VoiceOver don't announce repeated, identical strings. We use