Prune elements with display none to fix regression.

In an earlier emogridier version (til WC 3.9.3) this was happening by
default, however now we have to do this explicitly since we update
emogrifier to > 3.x.
This commit is contained in:
vedanshujain 2020-04-03 13:47:04 +00:00
parent 8ab5df1df2
commit 6612d1f859
1 changed files with 3 additions and 0 deletions

View File

@ -567,6 +567,9 @@ class WC_Email extends WC_Settings_API {
do_action( 'woocommerce_emogrifier', $emogrifier, $this );
$content = $emogrifier->emogrify();
$html_prune = \Pelago\Emogrifier\HtmlProcessor\HtmlPruner::fromHtml( $content );
$html_prune->removeElementsWithDisplayNone();
$content = $html_prune->render();
} catch ( Exception $e ) {
$logger = wc_get_logger();
$logger->error( $e->getMessage(), array( 'source' => 'emogrifier' ) );