]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/js/shortcode.js
WordPress 4.6.3-scripts
[autoinstalls/wordpress.git] / wp-includes / js / shortcode.js
index 2d319213fa31d67e1a28e105a8b076bcf6beb89b..79423eecfff2a37b4a0101e5116aab8be5b94487 100644 (file)
@@ -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, ' ' );
@@ -326,11 +326,6 @@ window.wp = window.wp || {};
                        _.each( options.attrs, function( value, attr ) {
                                text += ' ' + attr;
 
-                               // Use empty attribute notation where possible.
-                               if ( '' === value ) {
-                                       return;
-                               }
-
                                // Convert boolean values to strings.
                                if ( _.isBoolean( value ) ) {
                                        value = value ? 'true' : 'false';