Merge pull request #134 from grupotaric/fix-media-all-is-skipped

Avoid skipping links with media="all"
This commit is contained in:
Peter Bengtsson 2015-08-14 11:31:44 -07:00
commit 0a827f2132
1 changed files with 2 additions and 2 deletions

View File

@ -285,9 +285,9 @@ class Premailer(object):
for element in CSSSelector('style,link[rel~=stylesheet]')(page):
# If we have a media attribute whose value is anything other than
# 'screen', ignore the ruleset.
# 'all' or 'screen', ignore the ruleset.
media = element.attrib.get('media')
if media and media != 'screen':
if media and media not in ('all', 'screen'):
continue
data_attribute = element.attrib.get(self.attribute_name)