Ticket #2059: wpautop_no_removal_of_slashes_in_pre.patch
File wpautop_no_removal_of_slashes_in_pre.patch, 1.1 KB (added by , 19 years ago) |
---|
-
wp-includes/functions-formatting.php
51 51 $text = str_replace('<br />', '', $text); 52 52 $text = str_replace('<p>', "\n", $text); 53 53 $text = str_replace('</p>', '', $text); 54 $text = str_replace('\"', '"', $text); 54 55 return $text; 55 56 } 56 57 … … 73 74 if ($br) $pee = preg_replace('|(?<!<br />)\s*\n|', "<br />\n", $pee); // optionally make line breaks 74 75 $pee = preg_replace('!(</?(?:table|thead|tfoot|caption|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)\s*<br />!', "$1", $pee); 75 76 $pee = preg_replace('!<br />(\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)!', '$1', $pee); 76 $pee = preg_replace('!(<pre.*?>)(.*?)</pre>!ise', " stripslashes('$1') . stripslashes(clean_pre('$2')) . '</pre>' ", $pee);77 $pee = preg_replace('!(<pre.*?>)(.*?)</pre>!ise', " stripslashes('$1') . clean_pre('$2') . '</pre>' ", $pee); 77 78 78 79 return $pee; 79 80 }