- Fixes rendering issue where DOMDocument throws a notice on unescaped

html entity
This commit is contained in:
Vlad
2016-06-07 12:27:40 -04:00
parent 329ec63dfd
commit 713dda913e

View File

@ -60,16 +60,16 @@ class Renderer {
switch($selector) { switch($selector) {
case 'text': case 'text':
$selector = 'td.mailpoet_paragraph, td.mailpoet_blockquote, li.mailpoet_paragraph'; $selector = 'td.mailpoet_paragraph, td.mailpoet_blockquote, li.mailpoet_paragraph';
break; break;
case 'body': case 'body':
$selector = 'body, .mailpoet-wrapper'; $selector = 'body, .mailpoet-wrapper';
break; break;
case 'link': case 'link':
$selector = '.mailpoet-wrapper a'; $selector = '.mailpoet-wrapper a';
break; break;
case 'wrapper': case 'wrapper':
$selector = '.mailpoet_content-wrapper'; $selector = '.mailpoet_content-wrapper';
break; break;
} }
$css .= StylesHelper::setStyle($style, $selector); $css .= StylesHelper::setStyle($style, $selector);
} }
@ -92,12 +92,16 @@ class Renderer {
} }
function postProcessTemplate($template) { function postProcessTemplate($template) {
// replace all !important tags except for in the body tag
$DOM = $this->DOM_parser->parseStr($template); $DOM = $this->DOM_parser->parseStr($template);
$template = $DOM->query('.mailpoet_template'); $template = $DOM->query('.mailpoet_template');
// replace all !important tags except for in the body tag
$template->html( $template->html(
str_replace('!important', '', $template->html()) str_replace('!important', '', $template->html())
); );
// encode ampersand
$template->html(
str_replace('&', '&', $template->html())
);
$template = apply_filters( $template = apply_filters(
'mailpoet_rendering_post_process', 'mailpoet_rendering_post_process',
$DOM->__toString() $DOM->__toString()