Skip to content

Commit

Permalink
Merge pull request #28 from wearejust/master
Browse files Browse the repository at this point in the history
Feature: Remove deprecated reference + always cleanup the <style> block
  • Loading branch information
ceesvanegmond committed Mar 10, 2016
2 parents 4955c29 + 9b065a3 commit 61ebd56
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
3 changes: 2 additions & 1 deletion src/CssInlinerPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ public function beforeSendPerformed(\Swift_Events_SendEvent $evt)
$message = $evt->getMessage();

$converter = new CssToInlineStyles();
$converter->setEncoding($message->getCharset());
$converter->setUseInlineStylesBlock();
$converter->setStripOriginalStyleTags();

$converter->setCleanup();

if ($message->getContentType() === 'text/html' ||
Expand Down
14 changes: 3 additions & 11 deletions tests/stubs/converted-html.stub
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><head><style>
.block {
width: 100px;
height: 20px;
}
div.block ul li.small {
margin: 10px;
}
</style></head><body>
<div style="height: 20px; width: 100px;">
<html><head><style></style></head><body>
<div style="height: 20px; width: 100px;">
text

<ul><li>
Big list
</li>
<li style="margin: 10px;">
<li style="margin: 10px;">
Small list
</li>
</ul></div>
Expand Down

0 comments on commit 61ebd56

Please sign in to comment.