Skip to content

Commit

Permalink
[+]: add missing CSS-Media-Queries from "setCSS()" v2 (fix tests)
Browse files Browse the repository at this point in the history
  • Loading branch information
voku committed Feb 8, 2017
1 parent 522e6e4 commit 3d9579b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/CssToInlineStyles.php
Expand Up @@ -304,7 +304,7 @@ public function convert($outputXHTML = false, $libXMLExtraOptions = null, $path
&&
$this->css_media_queries
) {
$html = str_ireplace('</head>', '<style type="text/css">' . "\n" . $this->css_media_queries . "\n" . '</styles></head>', $html);
$html = str_ireplace('</head>', "\n" . '<style type="text/css">' . "\n" . $this->css_media_queries . "\n" . '</styles>'. "\n" . '</head>', $html);
}

return $html;
Expand Down
4 changes: 3 additions & 1 deletion tests/CssToInlineStylesTest.php
Expand Up @@ -1027,14 +1027,16 @@ public function testIssue25()
<head>
<title>Testing</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<style type="text/css">
@media only screen and (min-width: 360px) {
div.col-25 { width: 100%; float: left; display: block;padding: 10px;}
}
@media only screen and (min-width: 120px) {
div.col-25 { width: 100%; display: block; padding: 15px;}
}
</styles>
</head>
<body style="-moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; margin: 0; padding: 0; width: 100%;">
<div class="row" style="-moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; clear: both; display: block; width: 100%;">
Expand Down
2 changes: 2 additions & 0 deletions tests/fixtures/test_big_result.html
Expand Up @@ -534,6 +534,7 @@
.footerContent a{display:block !important;} /* Place footer social and utility links on their own lines, for easier access */
}
</style>

<style type="text/css">
@media only screen and (max-width: 600px) {
table[class='body'] img {
Expand Down Expand Up @@ -649,6 +650,7 @@
}
}
</styles>
</head>
<body leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0" style="min-width: 100%; font-family: 'Helvetica', 'Arial', sans-serif; font-weight: normal; text-align: left; font-size: 14px; line-height: 19px; color: #474e5d; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; height: 100% !important; margin: 0; padding: 0; width: 100% !important; background-color: #DEE0E2;">
<center style="min-width: 580px; width: 100%;">
<table align="center" border="0" cellpadding="0" cellspacing="0" height="100%" width="600" id="bodyTable" style="border-spacing: 0; text-align: left; vertical-align: top; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; mso-table-lspace: 0pt; mso-table-rspace: 0pt; border-collapse: collapse !important; height: 100% !important; margin: 0; padding: 0; width: 100% !important; background-color: #DEE0E2;"><tr style="padding: 0; text-align: left; vertical-align: top;">
Expand Down

0 comments on commit 3d9579b

Please sign in to comment.