Index: src/wp-includes/formatting.php
===================================================================
--- src/wp-includes/formatting.php	(revision 28722)
+++ src/wp-includes/formatting.php	(working copy)
@@ -106,6 +106,11 @@
 			$dynamic[ '/(?<=\A|[([{<"]|' . $spaces . ')\'/' ] = $opening_single_quote;
 		}
 
+		// Apostrophe in a word.  No spaces or double apostrophes.
+		if ( "'" != $apos ) {
+			$dynamic[ '/(?<!' . $spaces . ')\'(?!\Z|\'|' . $spaces . ')/' ] = $apos;
+		}
+
 		// 9" (double prime)
 		if ( '"' !== $double_prime ) {
 			$dynamic[ '/(?<=\d)"/' ] = $double_prime;
@@ -116,11 +121,6 @@
 			$dynamic[ '/(?<=\d)\'/' ] = $prime;
 		}
 
-		// Apostrophe in a word.  No spaces or double primes.
-		if ( "'" !== $apos ) {
-			$dynamic[ '/(?<!' . $spaces . ')\'(?!\'|' . $spaces . ')/' ] = $apos;
-		}
-
 		// Double quote at start, or preceded by (, {, <, [, or spaces, and not followed by spaces.
 		if ( '"' !== $opening_quote ) {
 			$dynamic[ '/(?<=\A|[([{<]|' . $spaces . ')"(?!' . $spaces . ')/' ] = $opening_quote;
Index: tests/phpunit/tests/formatting/WPTexturize.php
===================================================================
--- tests/phpunit/tests/formatting/WPTexturize.php	(revision 28722)
+++ tests/phpunit/tests/formatting/WPTexturize.php	(working copy)
@@ -500,8 +500,8 @@
 				"word 99&#8242; word",
 			),
 			array(
-				"word 99'word",
-				"word 99&#8242;word",
+				"word 99'word", // Not a prime anymore. Apostrophes get priority.
+				"word 99&#8217;word",
 			),
 			array(
 				"word99' word",
@@ -508,8 +508,8 @@
 				"word99&#8242; word",
 			),
 			array(
-				"word99'word",
-				"word99&#8242;word",
+				"word99'word", // Not a prime anymore.
+				"word99&#8217;word",
 			),
 		);
 	}
