Skip to content

Commit

Permalink
Respect media tag in <style> nodes (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
madleech authored and christiaan committed May 21, 2014
1 parent 0f8ca30 commit 833dd85
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion InlineStyle/InlineStyle.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public function extractStylesheets($node = null, $base = '')
$removeQueue = array();
foreach($node->childNodes as $child) {
$nodeName = strtolower($child->nodeName);
if($nodeName === "style") {
if($nodeName === "style" && in_array(strtolower($child->getAttribute('media')), array('', 'screen'))) {
$stylesheets[] = $child->nodeValue;
$removeQueue[] = $child;
} else if($nodeName === "link" && strtolower($child->getAttribute('rel')) === 'stylesheet') {
Expand Down

0 comments on commit 833dd85

Please sign in to comment.