{"action":"created","comment":{"url":"https://api.github.com/repos/fphilipe/premailer-rails/pulls/comments/56788109","id":56788109,"diff_hunk":"@@ -39,6 +39,15 @@ def expect_file(path, content='file content')\n         expect(css_for_doc(doc)).to eq(\"content of base.css\\ncontent of font.css\")\n       end\n     end\n+\n+    context 'when HTML contains ignored links' do\n+      let(:files) { [\"stylesheets/ignore.css' data-premailer='ignore'\"] }","path":"spec/integration/css_helper_spec.rb","position":6,"original_position":6,"commit_id":"5adb21a0e60d21e6e4fd433a99a375a424f26775","original_commit_id":"5adb21a0e60d21e6e4fd433a99a375a424f26775","user":{"login":"fphilipe","id":128151,"avatar_url":"https://avatars.githubusercontent.com/u/128151?v=3","gravatar_id":"","url":"https://api.github.com/users/fphilipe","html_url":"https://github.com/fphilipe","followers_url":"https://api.github.com/users/fphilipe/followers","following_url":"https://api.github.com/users/fphilipe/following{/other_user}","gists_url":"https://api.github.com/users/fphilipe/gists{/gist_id}","starred_url":"https://api.github.com/users/fphilipe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fphilipe/subscriptions","organizations_url":"https://api.github.com/users/fphilipe/orgs","repos_url":"https://api.github.com/users/fphilipe/repos","events_url":"https://api.github.com/users/fphilipe/events{/privacy}","received_events_url":"https://api.github.com/users/fphilipe/received_events","type":"User","site_admin":false},"body":"Hmm, this is somewhat hacky. It's like a code injection exploiting a missing escape, as in a SQL injection. This array is passed to [`Fixtures::HTML.with_css_links`](https://github.com/fphilipe/premailer-rails/blob/e3da3d0f9d425ef5ffa71b5cb51bfb7499ebd458/spec/support/fixtures/html.rb#L25-L32) to construct an HTML file. What about augmenting [`Fixtures::HTML.with_css_links`] so that it also accepts hashes? Then, when the argument is a string, treat it as a hash like `{ href: the_string }`. For hashes, just treat the keys/values as the attributes/attribute values. Then, this line here becomes:\r\n\r\n```ruby\r\nlet(:files) { [{ href: 'stylesheets/ignore.css', 'data-premailer': 'ignore' }] }\r\n```\r\n\r\nWDYT?","created_at":"2016-03-21T07:35:41Z","updated_at":"2016-03-21T07:35:41Z","html_url":"https://github.com/fphilipe/premailer-rails/pull/154#discussion_r56788109","pull_request_url":"https://api.github.com/repos/fphilipe/premailer-rails/pulls/154","_links":{"self":{"href":"https://api.github.com/repos/fphilipe/premailer-rails/pulls/comments/56788109"},"html":{"href":"https://github.com/fphilipe/premailer-rails/pull/154#discussion_r56788109"},"pull_request":{"href":"https://api.github.com/repos/fphilipe/premailer-rails/pulls/154"}}},"pull_request":{"url":"https://api.github.com/repos/fphilipe/premailer-rails/pulls/154","id":63510248,"html_url":"https://github.com/fphilipe/premailer-rails/pull/154","diff_url":"https://github.com/fphilipe/premailer-rails/pull/154.diff","patch_url":"https://github.com/fphilipe/premailer-rails/pull/154.patch","issue_url":"https://api.github.com/repos/fphilipe/premailer-rails/issues/154","number":154,"state":"open","locked":false,"title":"Respect data-premailer=\"ignore\" on link tags","user":{"login":"alethea","id":4101392,"avatar_url":"https://avatars.githubusercontent.com/u/4101392?v=3","gravatar_id":"","url":"https://api.github.com/users/alethea","html_url":"https://github.com/alethea","followers_url":"https://api.github.com/users/alethea/followers","following_url":"https://api.github.com/users/alethea/following{/other_user}","gists_url":"https://api.github.com/users/alethea/gists{/gist_id}","starred_url":"https://api.github.com/users/alethea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alethea/subscriptions","organizations_url":"https://api.github.com/users/alethea/orgs","repos_url":"https://api.github.com/users/alethea/repos","events_url":"https://api.github.com/users/alethea/events{/privacy}","received_events_url":"https://api.github.com/users/alethea/received_events","type":"User","site_admin":false},"body":"I was working on a project that used a link tag to Google fonts, and I wanted to see if I could resolve #150. I changed the CSS selector used to search for link tags to `link[@rel='stylesheet']:not([@data-premailer='ignore'])` as [used in premailer](https://github.com/premailer/premailer/blob/8209d4bbd72200b0302eb8dcbd1c7ce8ab660057/lib/premailer/premailer.rb#L288). I also added a test for this behavior. ","created_at":"2016-03-20T22:44:18Z","updated_at":"2016-03-21T07:35:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d07f146e21567fb94fce2e28c413706b27df662f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/fphilipe/premailer-rails/pulls/154/commits","review_comments_url":"https://api.github.com/repos/fphilipe/premailer-rails/pulls/154/comments","review_comment_url":"https://api.github.com/repos/fphilipe/premailer-rails/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fphilipe/premailer-rails/issues/154/comments","statuses_url":"https://api.github.com/repos/fphilipe/premailer-rails/statuses/5adb21a0e60d21e6e4fd433a99a375a424f26775","head":{"label":"alethea:data-premailer-ignore","ref":"data-premailer-ignore","sha":"5adb21a0e60d21e6e4fd433a99a375a424f26775","user":{"login":"alethea","id":4101392,"avatar_url":"https://avatars.githubusercontent.com/u/4101392?v=3","gravatar_id":"","url":"https://api.github.com/users/alethea","html_url":"https://github.com/alethea","followers_url":"https://api.github.com/users/alethea/followers","following_url":"https://api.github.com/users/alethea/following{/other_user}","gists_url":"https://api.github.com/users/alethea/gists{/gist_id}","starred_url":"https://api.github.com/users/alethea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alethea/subscriptions","organizations_url":"https://api.github.com/users/alethea/orgs","repos_url":"https://api.github.com/users/alethea/repos","events_url":"https://api.github.com/users/alethea/events{/privacy}","received_events_url":"https://api.github.com/users/alethea/received_events","type":"User","site_admin":false},"repo":{"id":54339497,"name":"premailer-rails","full_name":"alethea/premailer-rails","owner":{"login":"alethea","id":4101392,"avatar_url":"https://avatars.githubusercontent.com/u/4101392?v=3","gravatar_id":"","url":"https://api.github.com/users/alethea","html_url":"https://github.com/alethea","followers_url":"https://api.github.com/users/alethea/followers","following_url":"https://api.github.com/users/alethea/following{/other_user}","gists_url":"https://api.github.com/users/alethea/gists{/gist_id}","starred_url":"https://api.github.com/users/alethea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alethea/subscriptions","organizations_url":"https://api.github.com/users/alethea/orgs","repos_url":"https://api.github.com/users/alethea/repos","events_url":"https://api.github.com/users/alethea/events{/privacy}","received_events_url":"https://api.github.com/users/alethea/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alethea/premailer-rails","description":"CSS styled emails without the hassle.","fork":true,"url":"https://api.github.com/repos/alethea/premailer-rails","forks_url":"https://api.github.com/repos/alethea/premailer-rails/forks","keys_url":"https://api.github.com/repos/alethea/premailer-rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alethea/premailer-rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alethea/premailer-rails/teams","hooks_url":"https://api.github.com/repos/alethea/premailer-rails/hooks","issue_events_url":"https://api.github.com/repos/alethea/premailer-rails/issues/events{/number}","events_url":"https://api.github.com/repos/alethea/premailer-rails/events","assignees_url":"https://api.github.com/repos/alethea/premailer-rails/assignees{/user}","branches_url":"https://api.github.com/repos/alethea/premailer-rails/branches{/branch}","tags_url":"https://api.github.com/repos/alethea/premailer-rails/tags","blobs_url":"https://api.github.com/repos/alethea/premailer-rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alethea/premailer-rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alethea/premailer-rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/alethea/premailer-rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alethea/premailer-rails/statuses/{sha}","languages_url":"https://api.github.com/repos/alethea/premailer-rails/languages","stargazers_url":"https://api.github.com/repos/alethea/premailer-rails/stargazers","contributors_url":"https://api.github.com/repos/alethea/premailer-rails/contributors","subscribers_url":"https://api.github.com/repos/alethea/premailer-rails/subscribers","subscription_url":"https://api.github.com/repos/alethea/premailer-rails/subscription","commits_url":"https://api.github.com/repos/alethea/premailer-rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/alethea/premailer-rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/alethea/premailer-rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/alethea/premailer-rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/alethea/premailer-rails/contents/{+path}","compare_url":"https://api.github.com/repos/alethea/premailer-rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alethea/premailer-rails/merges","archive_url":"https://api.github.com/repos/alethea/premailer-rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alethea/premailer-rails/downloads","issues_url":"https://api.github.com/repos/alethea/premailer-rails/issues{/number}","pulls_url":"https://api.github.com/repos/alethea/premailer-rails/pulls{/number}","milestones_url":"https://api.github.com/repos/alethea/premailer-rails/milestones{/number}","notifications_url":"https://api.github.com/repos/alethea/premailer-rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alethea/premailer-rails/labels{/name}","releases_url":"https://api.github.com/repos/alethea/premailer-rails/releases{/id}","deployments_url":"https://api.github.com/repos/alethea/premailer-rails/deployments","created_at":"2016-03-20T20:45:31Z","updated_at":"2016-03-20T20:45:32Z","pushed_at":"2016-03-20T22:38:34Z","git_url":"git://github.com/alethea/premailer-rails.git","ssh_url":"git@github.com:alethea/premailer-rails.git","clone_url":"https://github.com/alethea/premailer-rails.git","svn_url":"https://github.com/alethea/premailer-rails","homepage":"","size":210,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"fphilipe:master","ref":"master","sha":"e3da3d0f9d425ef5ffa71b5cb51bfb7499ebd458","user":{"login":"fphilipe","id":128151,"avatar_url":"https://avatars.githubusercontent.com/u/128151?v=3","gravatar_id":"","url":"https://api.github.com/users/fphilipe","html_url":"https://github.com/fphilipe","followers_url":"https://api.github.com/users/fphilipe/followers","following_url":"https://api.github.com/users/fphilipe/following{/other_user}","gists_url":"https://api.github.com/users/fphilipe/gists{/gist_id}","starred_url":"https://api.github.com/users/fphilipe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fphilipe/subscriptions","organizations_url":"https://api.github.com/users/fphilipe/orgs","repos_url":"https://api.github.com/users/fphilipe/repos","events_url":"https://api.github.com/users/fphilipe/events{/privacy}","received_events_url":"https://api.github.com/users/fphilipe/received_events","type":"User","site_admin":false},"repo":{"id":1561299,"name":"premailer-rails","full_name":"fphilipe/premailer-rails","owner":{"login":"fphilipe","id":128151,"avatar_url":"https://avatars.githubusercontent.com/u/128151?v=3","gravatar_id":"","url":"https://api.github.com/users/fphilipe","html_url":"https://github.com/fphilipe","followers_url":"https://api.github.com/users/fphilipe/followers","following_url":"https://api.github.com/users/fphilipe/following{/other_user}","gists_url":"https://api.github.com/users/fphilipe/gists{/gist_id}","starred_url":"https://api.github.com/users/fphilipe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fphilipe/subscriptions","organizations_url":"https://api.github.com/users/fphilipe/orgs","repos_url":"https://api.github.com/users/fphilipe/repos","events_url":"https://api.github.com/users/fphilipe/events{/privacy}","received_events_url":"https://api.github.com/users/fphilipe/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fphilipe/premailer-rails","description":"CSS styled emails without the hassle.","fork":false,"url":"https://api.github.com/repos/fphilipe/premailer-rails","forks_url":"https://api.github.com/repos/fphilipe/premailer-rails/forks","keys_url":"https://api.github.com/repos/fphilipe/premailer-rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fphilipe/premailer-rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fphilipe/premailer-rails/teams","hooks_url":"https://api.github.com/repos/fphilipe/premailer-rails/hooks","issue_events_url":"https://api.github.com/repos/fphilipe/premailer-rails/issues/events{/number}","events_url":"https://api.github.com/repos/fphilipe/premailer-rails/events","assignees_url":"https://api.github.com/repos/fphilipe/premailer-rails/assignees{/user}","branches_url":"https://api.github.com/repos/fphilipe/premailer-rails/branches{/branch}","tags_url":"https://api.github.com/repos/fphilipe/premailer-rails/tags","blobs_url":"https://api.github.com/repos/fphilipe/premailer-rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fphilipe/premailer-rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fphilipe/premailer-rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/fphilipe/premailer-rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fphilipe/premailer-rails/statuses/{sha}","languages_url":"https://api.github.com/repos/fphilipe/premailer-rails/languages","stargazers_url":"https://api.github.com/repos/fphilipe/premailer-rails/stargazers","contributors_url":"https://api.github.com/repos/fphilipe/premailer-rails/contributors","subscribers_url":"https://api.github.com/repos/fphilipe/premailer-rails/subscribers","subscription_url":"https://api.github.com/repos/fphilipe/premailer-rails/subscription","commits_url":"https://api.github.com/repos/fphilipe/premailer-rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/fphilipe/premailer-rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/fphilipe/premailer-rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/fphilipe/premailer-rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/fphilipe/premailer-rails/contents/{+path}","compare_url":"https://api.github.com/repos/fphilipe/premailer-rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fphilipe/premailer-rails/merges","archive_url":"https://api.github.com/repos/fphilipe/premailer-rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fphilipe/premailer-rails/downloads","issues_url":"https://api.github.com/repos/fphilipe/premailer-rails/issues{/number}","pulls_url":"https://api.github.com/repos/fphilipe/premailer-rails/pulls{/number}","milestones_url":"https://api.github.com/repos/fphilipe/premailer-rails/milestones{/number}","notifications_url":"https://api.github.com/repos/fphilipe/premailer-rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fphilipe/premailer-rails/labels{/name}","releases_url":"https://api.github.com/repos/fphilipe/premailer-rails/releases{/id}","deployments_url":"https://api.github.com/repos/fphilipe/premailer-rails/deployments","created_at":"2011-04-03T00:05:17Z","updated_at":"2016-03-18T11:43:41Z","pushed_at":"2016-03-20T22:44:19Z","git_url":"git://github.com/fphilipe/premailer-rails.git","ssh_url":"git@github.com:fphilipe/premailer-rails.git","clone_url":"https://github.com/fphilipe/premailer-rails.git","svn_url":"https://github.com/fphilipe/premailer-rails","homepage":"","size":312,"stargazers_count":739,"watchers_count":739,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":152,"mirror_url":null,"open_issues_count":6,"forks":152,"open_issues":6,"watchers":739,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fphilipe/premailer-rails/pulls/154"},"html":{"href":"https://github.com/fphilipe/premailer-rails/pull/154"},"issue":{"href":"https://api.github.com/repos/fphilipe/premailer-rails/issues/154"},"comments":{"href":"https://api.github.com/repos/fphilipe/premailer-rails/issues/154/comments"},"review_comments":{"href":"https://api.github.com/repos/fphilipe/premailer-rails/pulls/154/comments"},"review_comment":{"href":"https://api.github.com/repos/fphilipe/premailer-rails/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fphilipe/premailer-rails/pulls/154/commits"},"statuses":{"href":"https://api.github.com/repos/fphilipe/premailer-rails/statuses/5adb21a0e60d21e6e4fd433a99a375a424f26775"}}}}