Index: src/wp-includes/js/shortcode.js
===================================================================
--- src/wp-includes/js/shortcode.js	(revision 28188)
+++ src/wp-includes/js/shortcode.js	(working copy)
@@ -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 );
 			}
 
@@ -353,4 +354,4 @@
 			return text + '</' + options.tag + '>';
 		}
 	});
-}());
\ No newline at end of file
+}());
Index: tests/qunit/wp-includes/js/shortcode.js
===================================================================
--- tests/qunit/wp-includes/js/shortcode.js	(revision 28188)
+++ tests/qunit/wp-includes/js/shortcode.js	(working copy)
@@ -57,6 +57,16 @@
 		equal( result, undefined, 'foo shortcode not found when escaped with params' );
 	});
 
+	test( 'next() should find shortcodes that are incorrectly escaped by newlines', function() {
+		var result;
+
+		result = wp.shortcode.next( 'foo', 'this has the [\n[foo]] shortcode' );
+		equal( result.index, 15, 'shortcode found when incorrectly escaping the start of it' );
+
+		result = wp.shortcode.next( 'foo', 'this has the [[foo]\n] shortcode' );
+		equal( result.index, 13, 'shortcode found when incorrectly escaping the end of it' );
+	});
+
 	test( 'next() should find the second instances of the shortcode when the first one is escaped', function() {
 		var result;
 
