commit e18aa9ff399aa2053e63cc78a130737b6311f606
Author: Leho Kraav <leho@kraav.com>
Date: Thu Nov 21 04:54:40 2013 +0200
Formatting: shortcode_unautop() should support shortcode attributes, see #14050
diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php
index 09f3b47..a13b612 100644
a
|
b
|
function shortcode_unautop( $pee ) { |
303 | 303 | . '\\/(?!\\])' // A forward slash not followed by a closing bracket |
304 | 304 | . '[^\\]\\/]*' // Not a closing bracket or forward slash |
305 | 305 | . ')*?' |
| 306 | . '[\\w\\s="\']*' // Shortcode attributes |
306 | 307 | . '(?:' |
307 | 308 | . '\\s*+' // Optional leading whitespace, supports [footag /] |
308 | 309 | . '\\/\\]' // Self closing tag and closing bracket |
commit f05a03e149de3d1a9deb9b94d772dc8a3a9e813a
Author: Leho Kraav <leho@kraav.com>
Date: Thu Nov 21 04:30:53 2013 +0200
Formatting: shortcode_unautop() clarifying comment, see #14050
diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php
index edbfb37..09f3b47 100644
a
|
b
|
function shortcode_unautop( $pee ) { |
310 | 310 | . '\\]' // Closing bracket |
311 | 311 | . '(?:' // Unroll the loop: Optionally, anything between the opening and closing shortcode tags |
312 | 312 | . '(?!<\/p>)' // Not followed by closing paragraph |
313 | | . '[^\\[]*+' // Not an opening bracket |
| 313 | . '[^\\[]*+' // Not an opening bracket, matches all content between closing bracket and closing shortcode tag |
314 | 314 | . '(?:' |
315 | 315 | . '\\[(?!\\/\\2\\])' // An opening bracket not followed by the closing shortcode tag |
316 | 316 | . '[^\\[]*+' // Not an opening bracket |
commit 2bddf791741216b214b6d01a2bf2943de8cb1899
Author: Leho Kraav <leho@kraav.com>
Date: Thu Nov 21 04:30:21 2013 +0200
Formatting: shortcode_unautop() should support shortcodes on separate lines, see #14050
Handles scenarios like
{{{
<p>[footag]</p>
<p>Enjoy guided day walks in extraordinary natural areas. Return to
comfortable accommodation and delicious meals each evening. No heavy
backpack, no camping.</p>
<p>[/footag]</p>
}}}
diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php
index 542ae0c..edbfb37 100644
a
|
b
|
function shortcode_unautop( $pee ) { |
294 | 294 | . '<p>' // Opening paragraph |
295 | 295 | . '\\s*+' // Optional leading whitespace |
296 | 296 | . '(' // 1: The shortcode |
297 | | . '\\[' // Opening bracket |
| 297 | . '\\[\\/?' // Opening bracket for opening or closing shortcode tag |
298 | 298 | . "($tagregexp)" // 2: Shortcode name |
299 | 299 | . '(?![\\w-])' // Not followed by word character or hyphen |
300 | 300 | // Unroll the loop: Inside the opening shortcode tag |
… |
… |
function shortcode_unautop( $pee ) { |
309 | 309 | . '|' |
310 | 310 | . '\\]' // Closing bracket |
311 | 311 | . '(?:' // Unroll the loop: Optionally, anything between the opening and closing shortcode tags |
| 312 | . '(?!<\/p>)' // Not followed by closing paragraph |
312 | 313 | . '[^\\[]*+' // Not an opening bracket |
313 | 314 | . '(?:' |
314 | 315 | . '\\[(?!\\/\\2\\])' // An opening bracket not followed by the closing shortcode tag |
commit 2ac5bcdad72b369e227e353dffe7d68b493ea53d
Author: Leho Kraav <leho@kraav.com>
Date: Thu Nov 21 03:36:22 2013 +0200
Formatting: shortcode_unautop should support [footag /], see #14050
current version only supports [footag/].
https://codex.wordpress.org/Shortcode_API#Other_features_in_brief says
otherwise.
diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php
index 56aac4c..542ae0c 100644
a
|
b
|
function shortcode_unautop( $pee ) { |
304 | 304 | . '[^\\]\\/]*' // Not a closing bracket or forward slash |
305 | 305 | . ')*?' |
306 | 306 | . '(?:' |
| 307 | . '\\s*+' // Optional leading whitespace, supports [footag /] |
307 | 308 | . '\\/\\]' // Self closing tag and closing bracket |
308 | 309 | . '|' |
309 | 310 | . '\\]' // Closing bracket |