Skip to content

Instantly share code, notes, and snippets.

@jonathandavis
Created August 6, 2014 19:03
Show Gist options
  • Save jonathandavis/1763ccfc8b262b8fd845 to your computer and use it in GitHub Desktop.
Save jonathandavis/1763ccfc8b262b8fd845 to your computer and use it in GitHub Desktop.
<?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