mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-03 22:27:04 +00:00
Abstract the shortcode attribute parsing regex into its own function, update the JavaScript counterpart, and introduce a test to ensure they do not diverge again.
Fixes #34191 Props miqrogroove, johnbillion git-svn-id: https://develop.svn.wordpress.org/trunk@34933 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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, ' ' );
|
||||
|
||||
Reference in New Issue
Block a user