Skip to content

Commit ae0af89

Browse files
committed
MAGETWO-80209: [2.2.x] - Static versioning and styles minification break email fonts styles #8241 #10638
1 parent 03f7ded commit ae0af89

File tree

5 files changed

+65
-69
lines changed

5 files changed

+65
-69
lines changed

app/code/Magento/Email/Test/Unit/Model/Template/FilterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ public function applyInlineCssDataProvider()
369369
'<html><head><style type="text/css">div { color: #111; }</style></head><p></p></html>',
370370
'p { color: #000 }',
371371
[
372-
'<head><style type="text/css">div { color: #111; }</style></head>',
372+
'<style type="text/css">div { color: #111; }</style>',
373373
'<p style="color: #000;"></p>',
374374
],
375375
],

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"composer/composer": "1.4.1",
4343
"monolog/monolog": "^1.17",
4444
"oyejorge/less.php": "~1.7.0",
45-
"pelago/emogrifier": "0.1.1",
45+
"pelago/emogrifier": "1.2.0",
4646
"tubalmartin/cssmin": "4.1.0",
4747
"magento/magento-composer-installer": ">=0.1.11",
4848
"braintree/braintree_php": "3.22.0",

composer.lock

Lines changed: 59 additions & 55 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/Adapter/CssInlinerTest.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,10 @@ public function testGetFilesEmogrifier($htmlFilePath, $cssFilePath, $cssExpected
7676
$emogrifier->setHtml($html);
7777
$result = $emogrifier->emogrify();
7878
/**
79-
* Tests a bug in the library where there's no spaces to CSS string before passing to Emogrifier
80-
* to fix known parsing issue with library.
81-
* This test should will fail when this bug is fixed in the library and we should fix the adapter.
82-
* https://github.com/jjriv/emogrifier/issues/370
79+
* This test was implemented for the issue which existed in the older version of Emogrifier.
80+
* Test was updated, as the library got updated as well.
8381
*/
84-
$this->assertNotContains($cssExpected, $result);
82+
$this->assertContains($cssExpected, $result);
8583
}
8684

8785
/**

lib/internal/Magento/Framework/Css/PreProcessor/Adapter/CssInliner.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,7 @@ public function setHtml($html)
4141
*/
4242
public function setCss($css)
4343
{
44-
/**
45-
* Adds space to CSS string before passing to Emogrifier to fix known parsing issue with library.
46-
* https://github.com/jjriv/emogrifier/issues/370
47-
*/
48-
$cssWithAddedSpaces = preg_replace('#([\{\}>])#i', ' $1 ', $css);
49-
50-
$this->emogrifier->setCss($cssWithAddedSpaces);
44+
$this->emogrifier->setCss($css);
5145
}
5246

5347
/**

0 commit comments

Comments
 (0)