# This patch file was generated by NetBeans IDE
# Following Index: paths are relative to: C:\xampp\htdocs\wordpress\sandbox\wp-includes
# This patch can be applied using context Tools: Patch action on respective folder.
# It uses platform neutral UTF-8 encoding and \n newlines.
# Above lines and this line are ignored by the patching process.
|
|
|
|
| 178 | 178 | $pee = preg_replace('!(<' . $allblocks . '[^>]*>)!', "\n$1", $pee); |
| 179 | 179 | $pee = preg_replace('!(</' . $allblocks . '>)!', "$1\n\n", $pee); |
| 180 | 180 | $pee = str_replace(array("\r\n", "\r"), "\n", $pee); // cross-platform newlines |
| | 181 | |
| | 182 | // Pull out any PRE tags so they're not affected at all |
| | 183 | $pres = array(); |
| | 184 | if ( strpos($pee, '<pre') !== false ){ |
| | 185 | preg_match_all( '!<pre[^>]*>.+?</pre>!is', $pee, $pres ); |
| | 186 | if ( count( $pres ) ){ |
| | 187 | $pee = preg_replace( '!<pre[^>]*>.+?</pre>!is', '<WPPreservePre />', $pee ); |
| | 188 | } |
| | 189 | } |
| | 190 | |
| 181 | 191 | if ( strpos($pee, '<object') !== false ) { |
| 182 | 192 | $pee = preg_replace('|\s*<param([^>]*)>\s*|', "<param$1>", $pee); // no pee inside object/embed |
| 183 | 193 | $pee = preg_replace('|\s*</embed>\s*|', '</embed>', $pee); |
| … |
… |
|
| 203 | 213 | } |
| 204 | 214 | $pee = preg_replace('!(</?' . $allblocks . '[^>]*>)\s*<br />!', "$1", $pee); |
| 205 | 215 | $pee = preg_replace('!<br />(\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)!', '$1', $pee); |
| 206 | | if (strpos($pee, '<pre') !== false) |
| 207 | | $pee = preg_replace_callback('!(<pre[^>]*>)(.*?)</pre>!is', 'clean_pre', $pee ); |
| | 216 | |
| | 217 | // Substitute our preserved PREs back in |
| | 218 | if ( count( $pres ) ){ |
| | 219 | foreach ( $pres as $pre ){ |
| | 220 | $pee = preg_replace( '!<WPPreservePre />!', $pre[0], $pee, 1 ); |
| | 221 | } |
| | 222 | } |
| | 223 | |
| | 224 | // We don't need this any more. Better to leave all <pre> content untouched |
| | 225 | // if (strpos($pee, '<pre') !== false) |
| | 226 | // $pee = preg_replace_callback('!(<pre[^>]*>)(.*?)</pre>!is', 'clean_pre', $pee ); |
| | 227 | |
| 208 | 228 | $pee = preg_replace( "|\n</p>$|", '</p>', $pee ); |
| 209 | 229 | |
| 210 | 230 | return $pee; |