' . $html . ' '; return $template; } static function convertParagraphsToTables($html) { $html = preg_replace('/

(.*?)<\/p>/', '
$1

' , $html); $html = preg_replace('/

(.*?)<\/p>/', '
$2

' , $html); return $html; } static function removeLastElementBreakLine($html) { return preg_replace('/([^]*)$/s', '', $html); } static function addLineBreakAfterTags($html) { return preg_replace('/(<\/(ul|ol|h\d)>)/', '$1
', $html); } static function convertBlockquotesToTables($html) { $template = '
$1

'; preg_match('/

.*?<\/blockquote>/s', $html, $blockquotes); foreach($blockquotes as $index => $blockquote) { $blockquote = preg_replace('/<\/p>\n

/', '

', $blockquote); $blockquote = preg_replace('/<\/?p>/', '', $blockquote); $blockquote = preg_replace( '/

(.*?)<\/blockquote>/s', $template, $blockquote ); $html = preg_replace( '/' . preg_quote($blockquotes[$index], '/') . '/', $blockquote, $html ); } return $html; } static function styleHeadings($html) { return preg_replace( '/<(h[1-6])(?:\s+style=\"(.*)?\")?>/', '<$1 style="margin:0;font-style:normal;font-weight:normal;$2">', $html ); } static function styleLists($html) { $html = preg_replace( '/<(ul|ol)>/', '<$1 class="mailpoet_paragraph" style="padding-top:0;padding-bottom:0;margin-top:0;margin-bottom:0;">', $html ); $html = preg_replace('/
  • /', '
  • ', $html); return $html; } }