From 8ee4986acbc68ab78bda74de02239f30d0d8e6b2 Mon Sep 17 00:00:00 2001 From: Matt Mullenweg Date: Mon, 22 Mar 2004 01:34:32 +0000 Subject: [PATCH] Texturize kung-foo git-svn-id: https://develop.svn.wordpress.org/trunk@985 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/functions-formatting.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wp-includes/functions-formatting.php b/wp-includes/functions-formatting.php index 8726f33556..cfb73b1cc6 100644 --- a/wp-includes/functions-formatting.php +++ b/wp-includes/functions-formatting.php @@ -18,14 +18,14 @@ function wptexturize($text) { $cockneyreplace = array("’tain’t","’twere","’twas","’tis","’twill","’til","’bout","’nuff","’round"); $curl = str_replace($cockney, $cockneyreplace, $curl); - $curl = preg_replace("/'s/", "’s", $curl); + $curl = preg_replace("/'s/", '’s', $curl); $curl = preg_replace("/'(\d\d(?:’|')?s)/", "’$1", $curl); $curl = preg_replace('/(\s|\A|")\'/', '$1‘', $curl); - $curl = preg_replace("/(\d+)\"/", "$1″", $curl); - $curl = preg_replace("/(\d+)'/", "$1′", $curl); + $curl = preg_replace('/(\d+)"/', '$1″', $curl); + $curl = preg_replace("/(\d+)'/", '$1′', $curl); $curl = preg_replace("/(\S)'([^'\s])/", "$1’$2", $curl); - $curl = preg_replace('/"([\s.,!?;:&\']|\Z)/', '”$1', $curl); - $curl = preg_replace('/(\s|\A)"/', '$1“', $curl); + $curl = preg_replace('/(\s|\A)"(?!\s)/', '$1“$2', $curl); + $curl = preg_replace('/"(\s|\Z)/', '”$1', $curl); $curl = preg_replace("/'([\s.]|\Z)/", '’$1', $curl); $curl = preg_replace("/\(tm\)/i", '™', $curl); $curl = preg_replace("/\(c\)/i", '©', $curl);