Index: trunk/wp-includes/js/shortcode.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- trunk/wp-includes/js/shortcode.js	(revision 27989)
+++ trunk/wp-includes/js/shortcode.js	(revision )
@@ -34,15 +34,16 @@
 				shortcode: wp.shortcode.fromMatch( match )
 			};
 
-			// If we matched a leading `[`, strip it from the match
-			// and increment the index accordingly.
-			if ( match[1] ) {
+			// If we matched a leading `[`, and it has a matching counterpart,
+			// strip it from the match and increment the index accordingly.
+			if ( match[1] && typeof result.match !== 'undefined' ) {
 				result.match = result.match.slice( 1 );
 				result.index++;
 			}
 
-			// If we matched a trailing `]`, strip it from the match.
-			if ( match[7] ) {
+			// If we matched a trailing `]`, , and it has a matching counterpart,
+			// strip it from the match.
+			if ( match[7] && typeof result.match !== 'undefined' ) {
 				result.match = result.match.slice( 0, -1 );
 			}
 
\ No newline at end of file
