Index: src/wp-includes/formatting.php
===================================================================
--- src/wp-includes/formatting.php	(revision 28943)
+++ src/wp-includes/formatting.php	(working copy)
@@ -104,11 +104,10 @@
 
 		// '99' and '99" are ambiguous among other patterns; assume it's an abbreviated year at the end of a quotation.
 		if ( "'" !== $apos || "'" !== $closing_single_quote ) {
-			$dynamic[ '/\'(\d\d)\'(?=\Z|[.,)}>\-\]]|' . $spaces . ')/' ] = $apos . '$1' . $closing_single_quote;
+			$dynamic[ '/\'(\d\d)\'(?=\Z|[.,)}\-\]]|&gt;|' . $spaces . ')/' ] = $apos . '$1' . $closing_single_quote;
 		}
-
 		if ( "'" !== $apos || '"' !== $closing_quote ) {
-			$dynamic[ '/\'(\d\d)"(?=\Z|[.,)}>\-\]]|' . $spaces . ')/' ] = $apos . '$1' . $closing_quote;
+			$dynamic[ '/\'(\d\d)"(?=\Z|[.,)}\-\]]|&gt;|' . $spaces . ')/' ] = $apos . '$1' . $closing_quote;
 		}
 
 		// '99 '99s '99's (apostrophe)  But never '9 or '99% or '999 or '99.0.
@@ -126,12 +125,12 @@
 
 		// Single quote at start, or preceded by (, {, <, [, ", -, or spaces.
 		if ( "'" !== $opening_single_quote ) {
-			$dynamic[ '/(?<=\A|[([{<"\-]|' . $spaces . ')\'/' ] = $opening_single_quote;
+			$dynamic[ '/(?<=\A|[([{"\-]|&lt;|' . $spaces . ')\'/' ] = $opening_single_quote;
 		}
 
 		// Apostrophe in a word.  No spaces, double apostrophes, or other punctuation.
 		if ( "'" !== $apos ) {
-			$dynamic[ '/(?<!' . $spaces . ')\'(?!\Z|[.,:;"\'(){}<>[\]\-]|' . $spaces . ')/' ] = $apos;
+			$dynamic[ '/(?<!' . $spaces . ')\'(?!\Z|[.,:;"\'(){}[\]\-]|&[lg]t;|' . $spaces . ')/' ] = $apos;
 		}
 
 		// 9" (double prime)
@@ -146,7 +145,7 @@
 
 		// Double quote at start, or preceded by (, {, <, [, -, or spaces, and not followed by spaces.
 		if ( '"' !== $opening_quote ) {
-			$dynamic[ '/(?<=\A|[([{<\-]|' . $spaces . ')"(?!' . $spaces . ')/' ] = $opening_quote;
+			$dynamic[ '/(?<=\A|[([{\-]|&lt;|' . $spaces . ')"(?!' . $spaces . ')/' ] = $opening_quote;
 		}
 
 		// Any remaining double quotes.
@@ -156,7 +155,7 @@
 
 		// Single quotes followed by spaces or ending punctuation.
 		if ( "'" !== $closing_single_quote ) {
-			$dynamic[ '/\'(?=\Z|[.,)}>\-\]]|' . $spaces . ')/' ] = $closing_single_quote;
+			$dynamic[ '/\'(?=\Z|[.,)}\-\]]|&gt;|' . $spaces . ')/' ] = $closing_single_quote;
 		}
 
 		// Dashes and spaces
Index: tests/phpunit/tests/formatting/WPTexturize.php
===================================================================
--- tests/phpunit/tests/formatting/WPTexturize.php	(revision 28943)
+++ tests/phpunit/tests/formatting/WPTexturize.php	(working copy)
@@ -117,6 +117,9 @@
 		$this->assertEquals('&#8216;Class of &#8217;99&#8217;s&#8217;', wptexturize("'Class of '99&#8217;s'"));
 		//$this->assertEquals('&#8220;Class of 99&#8221;', wptexturize("\"Class of 99\""));
 		$this->assertEquals('&#8220;Class of &#8217;99&#8221;', wptexturize("\"Class of '99\""));
+		$this->assertEquals('{&#8220;Class of &#8217;99&#8221;}', wptexturize("{\"Class of '99\"}"));
+		$this->assertEquals(' &#8220;Class of &#8217;99&#8221; ', wptexturize(" \"Class of '99\" "));
+		$this->assertEquals('}&#8220;Class of &#8217;99&#8221;{', wptexturize("}\"Class of '99\"{")); // Not a quotation, may be between two other quotations.
 	}
 
 	function test_quotes_after_numbers() {
@@ -346,12 +349,12 @@
 				"word [&#8216;word word",
 			),
 			array(
-				"word <'word word", // Invalid HTML input?
-				"word <&#8216;word word",
+				"word <'word word", // Invalid HTML input triggers the apos in a word pattern.
+				"word <&#8217;word word",
 			),
 			array(
-				"word &lt;'word word", // Valid HTML input triggers the apos in a word pattern
-				"word &lt;&#8217;word word",
+				"word &lt;'word word", // Valid HTML input makes curly quotes.
+				"word &lt;&#8216;word word",
 			),
 			array(
 				"word {'word word",
@@ -375,11 +378,11 @@
 			),
 			array(
 				"word<'word word",
-				"word<&#8216;word word",
+				"word<&#8217;word word",
 			),
 			array(
 				"word&lt;'word word",
-				"word&lt;&#8217;word word",
+				"word&lt;&#8216;word word",
 			),
 			array(
 				"word{'word word",
@@ -402,12 +405,12 @@
 				"word [&#8216; word word",
 			),
 			array(
-				"word <' word word", // Invalid HTML input?
-				"word <&#8216; word word",
+				"word <' word word",
+				"word <&#8217; word word",
 			),
 			array(
-				"word &lt;' word word", // Valid HTML input triggers the closing single quote here
-				"word &lt;&#8217; word word",
+				"word &lt;' word word",
+				"word &lt;&#8216; word word",
 			),
 			array(
 				"word {' word word",
@@ -431,11 +434,11 @@
 			),
 			array(
 				"word<' word word",
-				"word<&#8216; word word",
+				"word<&#8217; word word",
 			),
 			array(
 				"word&lt;' word word",
-				"word&lt;&#8217; word word",
+				"word&lt;&#8216; word word",
 			),
 			array(
 				"word{' word word",
@@ -533,34 +536,30 @@
 				"word word&#8217;s word",
 			),
 			array(
-				"word word'. word", // Quotes with outside punctuation could end with apostrophes instead of closing quotes (may affect i18n)
-				"word word&#8217;. word",
+				"word'[ word", // Apostrophes are never followed by opening punctuation.
+				"word'[ word",
 			),
 			array(
-				"word ]'. word",
-				"word ]&#8217;. word",
+				"word'( word",
+				"word'( word",
 			),
 			array(
-				"word )'. word",
-				"word )&#8217;. word",
+				"word'{ word",
+				"word'{ word",
 			),
 			array(
-				"word }'. word",
-				"word }&#8217;. word",
+				"word'&lt; word",
+				"word'&lt; word",
 			),
 			array(
-				"word >'. word", // Not tested
-				"word >&#8217;. word",
+				"word'< word", // Invalid HTML input does trigger the apos pattern.
+				"word&#8217;< word",
 			),
-			array(
-				"word &gt;'. word",
-				"word &gt;&#8217;. word",
-			),
 		);
 	}
 
 	/**
-	 * Double quote after a space or ([{< becomes &#8220; (opening_quote) if not followed by spaces
+	 * Double quote after a space or ([-{< becomes &#8220; (opening_quote) if not followed by spaces
 	 *
 	 * Checks all baseline patterns. If anything ever changes in wptexturize(), these tests may fail.
 	 *
@@ -586,12 +585,12 @@
 				'word [&#8220;word word',
 			),
 			array(
-				'word <"word word', // Invalid HTML input?
-				'word <&#8220;word word',
+				'word <"word word', // Invalid HTML input triggers the closing quote pattern.
+				'word <&#8221;word word',
 			),
 			array(
-				'word &lt;"word word', // Valid HTML input triggers the closing quote pattern
-				'word &lt;&#8221;word word',
+				'word &lt;"word word',
+				'word &lt;&#8220;word word',
 			),
 			array(
 				'word {"word word',
@@ -598,6 +597,14 @@
 				'word {&#8220;word word',
 			),
 			array(
+				'word -"word word',
+				'word -&#8220;word word',
+			),
+			array(
+				'word-"word word',
+				'word-&#8220;word word',
+			),
+			array(
 				'"word word',
 				'&#8220;word word',
 			),
@@ -698,7 +705,7 @@
 	}
 
 	/**
-	 * Test that single quotes followed by a space or a period become &#8217; (closing_single_quote)
+	 * Test that single quotes followed by a space or .,-)}]> become &#8217; (closing_single_quote)
 	 *
 	 * Checks all baseline patterns. If anything ever changes in wptexturize(), these tests may fail.
 	 *
@@ -728,6 +735,26 @@
 				"word word&#8217;, she said",
 			),
 			array(
+				"word word'- word",
+				"word word&#8217;- word",
+			),
+			array(
+				"word word') word",
+				"word word&#8217;) word",
+			),
+			array(
+				"word word'} word",
+				"word word&#8217;} word",
+			),
+			array(
+				"word word'] word",
+				"word word&#8217;] word",
+			),
+			array(
+				"word word'&gt; word",
+				"word word&#8217;&gt; word",
+			),
+			array(
 				"word word'",
 				"word word&#8217;",
 			),
