| @@ 484-487 (lines=4) @@ | ||
| 481 | $pee = wp_replace_in_html_tags( $pee, array( "\n" => " <!-- wpnl --> " ) ); |
|
| 482 | ||
| 483 | // Collapse line breaks before and after <option> elements so they don't get autop'd. |
|
| 484 | if ( strpos( $pee, '<option' ) !== false ) { |
|
| 485 | $pee = preg_replace( '|\s*<option|', '<option', $pee ); |
|
| 486 | $pee = preg_replace( '|</option>\s*|', '</option>', $pee ); |
|
| 487 | } |
|
| 488 | ||
| 489 | /* |
|
| 490 | * Collapse line breaks inside <object> elements, before <param> and <embed> elements |
|
| @@ 510-513 (lines=4) @@ | ||
| 507 | } |
|
| 508 | ||
| 509 | // Collapse line breaks before and after <figcaption> elements. |
|
| 510 | if ( strpos( $pee, '<figcaption' ) !== false ) { |
|
| 511 | $pee = preg_replace( '|\s*(<figcaption[^>]*>)|', '$1', $pee ); |
|
| 512 | $pee = preg_replace( '|</figcaption>\s*|', '</figcaption>', $pee ); |
|
| 513 | } |
|
| 514 | ||
| 515 | // Remove more than two contiguous line breaks. |
|
| 516 | $pee = preg_replace("/\n\n+/", "\n\n", $pee); |
|
| @@ 42-46 (lines=5) @@ | ||
| 39 | { |
|
| 40 | // Detect line breaks. |
|
| 41 | $lnbr = "\n"; |
|
| 42 | if (strpos($diff, "\r\n") !== false) { |
|
| 43 | $lnbr = "\r\n"; |
|
| 44 | } elseif (strpos($diff, "\r") !== false) { |
|
| 45 | $lnbr = "\r"; |
|
| 46 | } |
|
| 47 | ||
| 48 | // Make sure we have a line break at the EOF. |
|
| 49 | if (substr($diff, -strlen($lnbr)) != $lnbr) { |
|