X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/9e77185fafaf4e60e2b73821e0e4b9b1a11fb85f..refs/tags/wordpress-4.4:/wp-includes/js/shortcode.js diff --git a/wp-includes/js/shortcode.js b/wp-includes/js/shortcode.js index 2d319213..7028f6a8 100644 --- a/wp-includes/js/shortcode.js +++ b/wp-includes/js/shortcode.js @@ -1,4 +1,4 @@ -// Utility functions for parsing and handling shortcodes in Javascript. +// Utility functions for parsing and handling shortcodes in JavaScript. // Ensure the global `wp` object exists. window.wp = window.wp || {}; @@ -135,7 +135,7 @@ window.wp = window.wp || {}; // 6. an unquoted value. // 7. A numeric attribute in double quotes. // 8. An unquoted numeric attribute. - pattern = /(\w+)\s*=\s*"([^"]*)"(?:\s|$)|(\w+)\s*=\s*\'([^\']*)\'(?:\s|$)|(\w+)\s*=\s*([^\s\'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|(\S+)(?:\s|$)/g; + pattern = /([\w-]+)\s*=\s*"([^"]*)"(?:\s|$)|([\w-]+)\s*=\s*'([^']*)'(?:\s|$)|([\w-]+)\s*=\s*([^\s'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|(\S+)(?:\s|$)/g; // Map zero-width spaces to actual spaces. text = text.replace( /[\u00a0\u200b]/g, ' ' );