Created
August 6, 2014 19:03
-
-
Save jonathandavis/1763ccfc8b262b8fd845 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
foreach ( $pees as $tinkle ) { | |
if ( preg_match( '!</?blockquote([^>]*)>!', $tinkle) >= 1 ) { | |
// pee inside blockquotes (prevents splashing) | |
$yellowblock = preg_replace('|<blockquote([^>]*)>|i', "<blockquote$1><p>", $tinkle); | |
$yellowblock = str_replace('</blockquote>', '</p></blockquote>', $yellowblock); | |
$pee .= $yellowblock . "\n"; | |
} elseif ( preg_match( '!</?' . $allblocks . '[^>]*>!', $tinkle ) >= 1 ) { | |
$pee .= trim($tinkle, "\n") . "\n"; // ignore wrapping block elements in the stream | |
} else { | |
$pee .= '<p>' . trim($tinkle, "\n") . "</p>\n"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment