Don't texturize things inside of script or style tags, fixes #2647
git-svn-id: https://develop.svn.wordpress.org/trunk@4565 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
56a74de876
commit
1e969aed95
|
@ -32,7 +32,7 @@ function wptexturize($text) {
|
|||
|
||||
// regular expressions
|
||||
$curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl);
|
||||
} elseif (strstr($curl, '<code') || strstr($curl, '<pre') || strstr($curl, '<kbd' || strstr($curl, '<style') || strstr($curl, '<script'))) {
|
||||
} elseif ( strstr($curl, '<code') || strstr($curl, '<pre') || strstr($curl, '<kbd') || strstr($curl, '<style') || strstr($curl, '<script') ) {
|
||||
$next = false;
|
||||
} else {
|
||||
$next = true;
|
||||
|
@ -63,6 +63,9 @@ function wpautop($pee, $br = 1) {
|
|||
$pee = preg_replace("/\n\n+/", "\n\n", $pee); // take care of duplicates
|
||||
$pee = preg_replace('/\n?(.+?)(?:\n\s*\n|\z)/s', "<p>$1</p>\n", $pee); // make paragraphs, including one at the end
|
||||
$pee = preg_replace('|<p>\s*?</p>|', '', $pee); // under certain strange conditions it could create a P of entirely whitespace
|
||||
$pee = preg_replace( '|<p>(<div[^>]*>\s*)|', "$1<p>", $pee );
|
||||
$pee = preg_replace('!<p>([^<]+)\s*?(</(?:div|address|form)[^>]*>)!', "<p>$1</p>$2", $pee);
|
||||
$pee = preg_replace( '|<p>|', "$1<p>", $pee );
|
||||
$pee = preg_replace('!<p>\s*(</?' . $allblocks . '[^>]*>)\s*</p>!', "$1", $pee); // don't pee all over a tag
|
||||
$pee = preg_replace("|<p>(<li.+?)</p>|", "$1", $pee); // problem with nested lists
|
||||
$pee = preg_replace('|<p><blockquote([^>]*)>|i', "<blockquote$1><p>", $pee);
|
||||
|
@ -79,6 +82,7 @@ function wpautop($pee, $br = 1) {
|
|||
if ( strstr( $pee, '<pre' ) )
|
||||
$pee = preg_replace('!(<pre.*?>)(.*?)</pre>!ise', " stripslashes('$1') . stripslashes(clean_pre('$2')) . '</pre>' ", $pee);
|
||||
$pee = preg_replace( "|\n</p>$|", '</p>', $pee );
|
||||
/**/
|
||||
return $pee;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue