Get rid of removing !important flags in render post process

[MAILPOET-1891]
This commit is contained in:
Rostislav Wolny
2019-04-02 17:31:51 +02:00
committed by M. Shull
parent 5e141148dc
commit fdb7dc971c
2 changed files with 1 additions and 5 deletions

View File

@@ -191,10 +191,6 @@ class Renderer {
$image->src = str_replace(' ', '%20', $image->src); $image->src = str_replace(' ', '%20', $image->src);
} }
$template = $template_dom->query('.mailpoet_template'); $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 // encode ampersand
$template->html( $template->html(
str_replace('&', '&', $template->html()) str_replace('&', '&', $template->html())

View File

@@ -72,7 +72,7 @@ class StylesHelper {
$styles = array_map(function($attribute, $style) use ($ignore_specific_styles) { $styles = array_map(function($attribute, $style) use ($ignore_specific_styles) {
if (!$ignore_specific_styles || !in_array($attribute, $ignore_specific_styles)) { if (!$ignore_specific_styles || !in_array($attribute, $ignore_specific_styles)) {
$style = StylesHelper::applyFontFamily($attribute, $style); $style = StylesHelper::applyFontFamily($attribute, $style);
return StylesHelper::translateCSSAttribute($attribute) . ': ' . $style . ' !important;'; return StylesHelper::translateCSSAttribute($attribute) . ': ' . $style . ';';
} }
}, array_keys($data[$type]), $data[$type]); }, array_keys($data[$type]), $data[$type]);
return implode('', $styles); return implode('', $styles);