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