Texturize preg_split .* should match newlines as well.
git-svn-id: http://svn.automattic.com/wordpress/trunk@455 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
71be4f1857
commit
363715a0e3
|
@ -17,7 +17,7 @@ if (!function_exists('floatval')) {
|
|||
/***** Formatting functions *****/
|
||||
function wptexturize($text) {
|
||||
$output = "";
|
||||
$textarr = preg_split("/(<.*>)/U", $text, -1, PREG_SPLIT_DELIM_CAPTURE); // capture the tags as well as in between
|
||||
$textarr = preg_split("/(<.*>)/Us", $text, -1, PREG_SPLIT_DELIM_CAPTURE); // capture the tags as well as in between
|
||||
$stop = count($textarr); $next = true; // loop stuff
|
||||
for ($i = 0; $i < $stop; $i++) {
|
||||
$curl = $textarr[$i];
|
||||
|
@ -77,7 +77,7 @@ function wpautop($pee, $br=1) {
|
|||
$pee = preg_replace('|<p><blockquote([^>]*)>|i', "<blockquote$1><p>", $pee);
|
||||
$pee = str_replace('</blockquote></p>', '</p></blockquote>', $pee);
|
||||
$pee = preg_replace('!<p>\s*(</?(?:table|tr|td|ul|ol|li|pre|select|form|blockquote|p|h[1-6])[^>]*>)!', "$1", $pee);
|
||||
$pee = preg_replace('!(</?(?:table|tr|td|ul|ol|li|pre|select|form|blockquote|p|h[1-6])>)\s*</p>!', "$1", $pee);
|
||||
$pee = preg_replace('!(</?(?:table|tr|td|ul|ol|li|pre|select|form|blockquote|p|h[1-6])[^>]*>)\s*</p>!', "$1", $pee);
|
||||
if ($br) $pee = preg_replace('|(?<!<br />)\s*\n|', "<br />\n", $pee); // optionally make line breaks
|
||||
$pee = preg_replace('!(</?(?:table|tr|td|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|p|h[1-6])[^>]*>)\s*<br />!', "$1", $pee);
|
||||
$pee = preg_replace('!<br />(\s*</?(?:p|li|pre|td|ul|ol)>)!', '$1', $pee);
|
||||
|
|
Loading…
Reference in New Issue