Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS Comments in @media #70

Closed
Sertion opened this issue May 23, 2014 · 4 comments
Closed

CSS Comments in @media #70

Sertion opened this issue May 23, 2014 · 4 comments

Comments

@Sertion
Copy link

Sertion commented May 23, 2014

When I run the premailer on the following document it returns an error.

Document:

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
    @media screen {
        /* comment */
    }
    </style>
</head>
<body></body>
</html>

Error:

albin@dev:~/premailer-tests$ python -m premailer -f temp.html
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/local/lib/python2.7/dist-packages/premailer/__main__.py", line 119, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/usr/local/lib/python2.7/dist-packages/premailer/__main__.py", line 114, in main
    options.outfile.write(p.transform())
  File "/usr/local/lib/python2.7/dist-packages/premailer/premailer.py", line 263, in transform
    for key in rule.style.keys():
AttributeError: 'CSSComment' object has no attribute 'style'
@peterbe
Copy link
Owner

peterbe commented May 23, 2014

@Sertion can you test out 14f7eb4 and see if that solves your problem. If so, I'll make a release.

@Sertion
Copy link
Author

Sertion commented May 26, 2014

I tested 14f7eb4 on the document with the issue and it works perfectly. Thank you!

@peterbe
Copy link
Owner

peterbe commented May 27, 2014

2.1.3 just for you :)
https://pypi.python.org/pypi/premailer/2.1.3

@Sertion
Copy link
Author

Sertion commented May 27, 2014

Thank you 👍

peterbe added a commit that referenced this issue Jun 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants