Index: wp-includes/formatting.php
===================================================================
--- wp-includes/formatting.php	(revision 35685)
+++ wp-includes/formatting.php	(working copy)
@@ -513,7 +513,14 @@
 
 	// Rebuild the content as a string, wrapping every bit with a <p>.
 	foreach ( $pees as $tinkle ) {
-		$pee .= '<p>' . trim($tinkle, "\n") . "</p>\n";
+		$tinkle = trim( $tinkle, "\n" );
+
+		// If this bit starts with a closing tag, don't wrap in paragraphs.
+		if ( '</' === substr( $tinkle, 0, 2 ) ) {
+			$pee .= $tinkle . "\n";
+		} else {
+			$pee .= '<p>' . $tinkle . "</p>\n";
+		}
 	}
 
 	// Under certain strange conditions it could create a P of entirely whitespace.
