{"action":"opened","issue":{"url":"https://api.github.com/repos/stylelint/stylelint/issues/1604","repository_url":"https://api.github.com/repos/stylelint/stylelint","labels_url":"https://api.github.com/repos/stylelint/stylelint/issues/1604/labels{/name}","comments_url":"https://api.github.com/repos/stylelint/stylelint/issues/1604/comments","events_url":"https://api.github.com/repos/stylelint/stylelint/issues/1604/events","html_url":"https://github.com/stylelint/stylelint/issues/1604","id":164427108,"number":1604,"title":"HTML extract breaks with SVG data URL","user":{"login":"Arcanemagus","id":427137,"avatar_url":"https://avatars.githubusercontent.com/u/427137?v=3","gravatar_id":"","url":"https://api.github.com/users/Arcanemagus","html_url":"https://github.com/Arcanemagus","followers_url":"https://api.github.com/users/Arcanemagus/followers","following_url":"https://api.github.com/users/Arcanemagus/following{/other_user}","gists_url":"https://api.github.com/users/Arcanemagus/gists{/gist_id}","starred_url":"https://api.github.com/users/Arcanemagus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Arcanemagus/subscriptions","organizations_url":"https://api.github.com/users/Arcanemagus/orgs","repos_url":"https://api.github.com/users/Arcanemagus/repos","events_url":"https://api.github.com/users/Arcanemagus/events{/privacy}","received_events_url":"https://api.github.com/users/Arcanemagus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-07T23:08:24Z","updated_at":"2016-07-07T23:08:24Z","closed_at":null,"body":"> Describe the issue. Is it a bug or a feature request (new rule, new option, etc.)?\r\n\r\nIt seems that when the HTML extraction feature is enabled and a `url()` is specified as the source of a property that is actually a `data:` URI containing a SVG element, the extraction breaks leading to a `no-empty-source` rule violation.\r\n\r\n> Which rule, if any, is this issue related to?\r\n\r\n`no-empty-source` (Most likely only exposing the underlying bug)\r\n\r\n> What CSS is needed to reproduce this issue?\r\n\r\n```css\r\nselect {\r\n  background-image: url(\"data:image/svg+xml;utf8,<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='24' height='24' viewBox='0 0 24 24'><path fill='#444' d='M7.406 7.828l4.594 4.594 4.594-4.594 1.406 1.406-6 6-6-6z'></path></svg>\");\r\n}\r\n```\r\n\r\n> What stylelint configuration is needed to reproduce this issue?\r\n\r\n```json\r\n{\r\n  \"rules\": {\r\n    \"no-empty-source\": true\r\n  }\r\n}\r\n```\r\n\r\n> Which version of stylelint are you using?\r\n\r\n`6.8.0` (Node, CLI) and `6.9.0` (CLI)\r\n\r\n> How are you running stylelint: CLI, PostCSS plugin, Node API?\r\n\r\nCLI with:\r\n\r\n* v6.8.0: `stylelint --extract .\\foo.css`\r\n* v6.9.0: `stylelint --extract true .\\foo.css`\r\n\r\n_Note: Will be filing a separate issue about the `--extract` option needing a \"buffer parameter\" in v6.9.0_\r\n\r\nNode API in Atom v1.9.0-beta0 (~Node.js v5.10.0) through `linter-stylelint@2.16.0`.\r\n\r\n> Does your issue relate to non-standard syntax (e.g. SCSS, nesting, etc.)?\r\n\r\nYes, it relates to extraction of CSS from within HTML.\r\n\r\n> What did you expect to happen?\r\n\r\nNo warnings to be flagged.\r\n\r\n> What actually happened (e.g. what warnings or errors you are getting)?\r\n\r\nThe following warnings were flagged:\r\n\r\n```shell\r\nfoo.css\r\n 1:1  ×  Unexpected empty source   no-empty-source\r\n```\r\n----\r\n\r\nNote that I'm almost positive this is a bug in the HTML extraction code, as seems to be falsely triggering on the embedded SVG element. `linter-stylelint` will no longer be always setting the flag enabling that to true for all files on the next release, instead only enabling it for files where it should be ran, but it should still have not caused this issue in the first place."}}
{"actor":{"display_login":"Arcanemagus"}}