Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed unit test
  • Loading branch information
konarshankar07 committed Jan 27, 2021
commit 2d621ef97195090b251ff156aa8c73754a2ef19f
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

use Magento\Framework\App\State;
use Pelago\Emogrifier\CssInliner as EmogrifierCssInliner;
use Symfony\Component\CssSelector\Exception\ParseException;

/**
* This class will inline the css of an html to each tag to be used for applications such as a styled email.
Expand Down Expand Up @@ -78,17 +79,19 @@ public function disableStyleBlocksParsing()
*
* @return string
* @throws \BadMethodCallException
* @throws ParseException
*/
public function process()
{
$emogrifier = EmogrifierCssInliner::fromHtml($this->html)
->inlineCss($this->css)
->setDebug($this->appState->getMode() === State::MODE_DEVELOPER);

if ($this->disableStyleBlocksParsing) {
$emogrifier->disableStyleBlocksParsing();
}

$emogrifier->inlineCss($this->css);

return $emogrifier->render();
}
}