{"action":"created","issue":{"url":"https://api.github.com/repos/peterbe/premailer/issues/184","repository_url":"https://api.github.com/repos/peterbe/premailer","labels_url":"https://api.github.com/repos/peterbe/premailer/issues/184/labels{/name}","comments_url":"https://api.github.com/repos/peterbe/premailer/issues/184/comments","events_url":"https://api.github.com/repos/peterbe/premailer/issues/184/events","html_url":"https://github.com/peterbe/premailer/issues/184","id":245092087,"number":184,"title":"Crashing when using on Semantic with exclude_pseudoclasses=False","user":{"login":"jddantes","id":6301574,"avatar_url":"https://avatars2.githubusercontent.com/u/6301574?v=4","gravatar_id":"","url":"https://api.github.com/users/jddantes","html_url":"https://github.com/jddantes","followers_url":"https://api.github.com/users/jddantes/followers","following_url":"https://api.github.com/users/jddantes/following{/other_user}","gists_url":"https://api.github.com/users/jddantes/gists{/gist_id}","starred_url":"https://api.github.com/users/jddantes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jddantes/subscriptions","organizations_url":"https://api.github.com/users/jddantes/orgs","repos_url":"https://api.github.com/users/jddantes/repos","events_url":"https://api.github.com/users/jddantes/events{/privacy}","received_events_url":"https://api.github.com/users/jddantes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-07-24T14:07:36Z","updated_at":"2017-07-25T15:41:53Z","closed_at":null,"body":"Tried running this script:\r\n```\r\n# Just a test script for premailer\r\n\r\nimport premailer\r\n\r\nhtml = \"\"\"\r\n    <html>\r\n    <link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.9/semantic.min.css\"/>\r\n    <style>\r\n        h1{ border: 1px solid blue}\r\n        h1:hover {border: 1px solid green}\r\n        \r\n    </style>\r\n    <h1>Hey</h1>\r\n    </html>\r\n\"\"\"\r\n\r\np = premailer.Premailer(html, exclude_pseudoclasses=False)\r\nprint(p.transform())\r\n```\r\n\r\nbut it crashes and returns:\r\n```\r\n...\r\nWARNING\tProperty: Unknown Property name.\r\nWARNING\tProperty: Unknown Property name.\r\nWARNING\tProperty: Unknown Property name.\r\nWARNING\tProperty: Unknown Property name.\r\nWARNING\tProperty: Unknown Property name.\r\nWARNING\tProperty: Unknown Property name.\r\nWARNING\tProperty: Unknown Property name.\r\nWARNING\tProperty: Unknown Property name.\r\nTraceback (most recent call last):\r\n  File \"prem.py\", line 18, in <module>\r\n    print(p.transform())\r\n  File \"/home/jddantes/.conda/envs/pulse/lib/python3.6/site-packages/premailer/premailer.py\", line 404, in transform\r\n    sel = CSSSelector(selector)\r\n  File \"/home/jddantes/.conda/envs/pulse/lib/python3.6/site-packages/lxml/cssselect.py\", line 94, in __init__\r\n    path = translator.css_to_xpath(css)\r\n  File \"/home/jddantes/.conda/envs/pulse/lib/python3.6/site-packages/cssselect/xpath.py\", line 192, in css_to_xpath\r\n    for selector in parse(css))\r\n  File \"/home/jddantes/.conda/envs/pulse/lib/python3.6/site-packages/cssselect/parser.py\", line 355, in parse\r\n    return list(parse_selector_group(stream))\r\n  File \"/home/jddantes/.conda/envs/pulse/lib/python3.6/site-packages/cssselect/parser.py\", line 370, in parse_selector_group\r\n    yield Selector(*parse_selector(stream))\r\n  File \"/home/jddantes/.conda/envs/pulse/lib/python3.6/site-packages/cssselect/parser.py\", line 378, in parse_selector\r\n    result, pseudo_element = parse_simple_selector(stream)\r\n  File \"/home/jddantes/.conda/envs/pulse/lib/python3.6/site-packages/cssselect/parser.py\", line 480, in parse_simple_selector\r\n    \"Expected selector, got %s\" % (stream.peek(),))\r\ncssselect.parser.SelectorSyntaxError: Expected selector, got <EOF at 0>\r\n\r\n```\r\n\r\npremailer==3.0.0\r\nlxml==3.8.0"},"comment":{"url":"https://api.github.com/repos/peterbe/premailer/issues/comments/317779626","html_url":"https://github.com/peterbe/premailer/issues/184#issuecomment-317779626","issue_url":"https://api.github.com/repos/peterbe/premailer/issues/184","id":317779626,"user":{"login":"peterbe","id":26739,"avatar_url":"https://avatars2.githubusercontent.com/u/26739?v=4","gravatar_id":"","url":"https://api.github.com/users/peterbe","html_url":"https://github.com/peterbe","followers_url":"https://api.github.com/users/peterbe/followers","following_url":"https://api.github.com/users/peterbe/following{/other_user}","gists_url":"https://api.github.com/users/peterbe/gists{/gist_id}","starred_url":"https://api.github.com/users/peterbe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterbe/subscriptions","organizations_url":"https://api.github.com/users/peterbe/orgs","repos_url":"https://api.github.com/users/peterbe/repos","events_url":"https://api.github.com/users/peterbe/events{/privacy}","received_events_url":"https://api.github.com/users/peterbe/received_events","type":"User","site_admin":false},"created_at":"2017-07-25T15:41:53Z","updated_at":"2017-07-25T15:41:53Z","body":"I managed to reproduce it with:\r\n```python\r\nhtml = \"\"\"\r\n    <html>\r\n    <style>\r\n        *,:after,:before{box-sizing:inherit}\r\n        h1{ border: 1px solid blue}\r\n        h1:hover {border: 1px solid green}\r\n\r\n    </style>\r\n    <h1>Hey</h1>\r\n    </html>\r\n\"\"\"\r\n```\r\nWhat happens is that the `selector` in the parsed rules becomes an empty string. "}}
{"actor":{"display_login":"peterbe"}}