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/wp-includes/formatting.php
+++ b/wp-includes/formatting.php
@@ -303,6 +303,7 @@ function shortcode_unautop( $pee ) {
 		.         '\\/(?!\\])'               // A forward slash not followed by a closing bracket
 		.         '[^\\]\\/]*'               // Not a closing bracket or forward slash
 		.     ')*?'
+		.     '[\\w\\s="\']*'                // Shortcode attributes
 		.     '(?:'
 		.         '\\s*+'                    // Optional leading whitespace, supports [footag /]
 		.         '\\/\\]'                   // 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/wp-includes/formatting.php
+++ b/wp-includes/formatting.php
@@ -310,7 +310,7 @@ function shortcode_unautop( $pee ) {
 		.         '\\]'                      // Closing bracket
 		.         '(?:'                      // Unroll the loop: Optionally, anything between the opening and closing shortcode tags
 		.             '(?!<\/p>)'            // Not followed by closing paragraph
-		.             '[^\\[]*+'             // Not an opening bracket
+		.             '[^\\[]*+'             // Not an opening bracket, matches all content between closing bracket and closing shortcode tag
 		.             '(?:'
 		.                 '\\[(?!\\/\\2\\])' // An opening bracket not followed by the closing shortcode tag
 		.                 '[^\\[]*+'         // 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/wp-includes/formatting.php
+++ b/wp-includes/formatting.php
@@ -294,7 +294,7 @@ function shortcode_unautop( $pee ) {
 		. '<p>'                              // Opening paragraph
 		. '\\s*+'                            // Optional leading whitespace
 		. '('                                // 1: The shortcode
-		.     '\\['                          // Opening bracket
+		.     '\\[\\/?'                      // Opening bracket for opening or closing shortcode tag
 		.     "($tagregexp)"                 // 2: Shortcode name
 		.     '(?![\\w-])'                   // Not followed by word character or hyphen
 		                                     // Unroll the loop: Inside the opening shortcode tag
@@ -309,6 +309,7 @@ function shortcode_unautop( $pee ) {
 		.     '|'
 		.         '\\]'                      // Closing bracket
 		.         '(?:'                      // Unroll the loop: Optionally, anything between the opening and closing shortcode tags
+		.             '(?!<\/p>)'            // Not followed by closing paragraph
 		.             '[^\\[]*+'             // Not an opening bracket
 		.             '(?:'
 		.                 '\\[(?!\\/\\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/wp-includes/formatting.php
+++ b/wp-includes/formatting.php
@@ -304,6 +304,7 @@ function shortcode_unautop( $pee ) {
 		.         '[^\\]\\/]*'               // Not a closing bracket or forward slash
 		.     ')*?'
 		.     '(?:'
+		.         '\\s*+'                    // Optional leading whitespace, supports [footag /]
 		.         '\\/\\]'                   // Self closing tag and closing bracket
 		.     '|'
 		.         '\\]'                      // Closing bracket
