Skip to content

Commit

Permalink
MAGETWO-71896: Merge branch 'MAGETWO-71896-PR-10638' of github.com:ma…
Browse files Browse the repository at this point in the history
…gento-engcom/magento2ce into develop-prs
  • Loading branch information
ishakhsuvarov committed Sep 4, 2017
2 parents bb5e7b9 + dfa6f87 commit 4271168
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,12 @@ public function testGetFilesEmogrifier($htmlFilePath, $cssFilePath, $cssExpected
$emogrifier->setCss($css);
$emogrifier->setHtml($html);
$result = $emogrifier->emogrify();

/**
* Tests a bug in the library where there's no spaces to CSS string before passing to Emogrifier
* to fix known parsing issue with library.
* This test should will fail when this bug is fixed in the library and we should fix the adapter.
* https://github.com/jjriv/emogrifier/issues/370
* This test was implemented for the issue which existed in the older version of Emogrifier.
* Test was updated, as the library got updated as well.
*/
$this->assertNotContains($cssExpected, $result);
$this->assertContains($cssExpected, $result);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,7 @@ public function setHtml($html)
*/
public function setCss($css)
{
/**
* Adds space to CSS string before passing to Emogrifier to fix known parsing issue with library.
* https://github.com/jjriv/emogrifier/issues/370
*/
$cssWithAddedSpaces = preg_replace('#([\{\}>])#i', ' $1 ', $css);

$this->emogrifier->setCss($cssWithAddedSpaces);
$this->emogrifier->setCss($css);
}

/**
Expand Down

0 comments on commit 4271168

Please sign in to comment.