{"action":"created","comment":{"url":"https://api.github.com/repos/mdn/browsercompat/pulls/comments/38754823","id":38754823,"diff_hunk":"@@ -722,10 +724,33 @@ class KumaVisitor(BaseKumaVisitor):\n     _default_attribute_actions = {None: 'ban'}\n \n     def visit_a_open(self, node, children):\n-        \"\"\"Ensure that <a> open tags have an href element.\"\"\"\n+        \"\"\"Validate and cleanup <a> open tags.\"\"\"\n         actions = self._default_attribute_actions.copy()\n         actions['href'] = 'must'\n-        return self._visit_open(node, children, actions)\n+        actions['title'] = 'drop'\n+        actions['class'] = 'keep'\n+        converted = self._visit_open(node, children, actions)\n+\n+        # Convert relative links to absolute links\n+        attrs = converted.attributes.attrs\n+        if 'href' in attrs:\n+            href = attrs['href'].value\n+            if href and href[0] == '/':\n+                attrs['href'].value = MDN_DOMAIN + href","path":"mdn/kumascript.py","position":36,"original_position":36,"commit_id":"785a1af6064f9a10f4d56b5bb83fc9da35634c79","original_commit_id":"785a1af6064f9a10f4d56b5bb83fc9da35634c79","user":{"login":"groovecoder","id":71928,"avatar_url":"https://avatars.githubusercontent.com/u/71928?v=3","gravatar_id":"","url":"https://api.github.com/users/groovecoder","html_url":"https://github.com/groovecoder","followers_url":"https://api.github.com/users/groovecoder/followers","following_url":"https://api.github.com/users/groovecoder/following{/other_user}","gists_url":"https://api.github.com/users/groovecoder/gists{/gist_id}","starred_url":"https://api.github.com/users/groovecoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/groovecoder/subscriptions","organizations_url":"https://api.github.com/users/groovecoder/orgs","repos_url":"https://api.github.com/users/groovecoder/repos","events_url":"https://api.github.com/users/groovecoder/events{/privacy}","received_events_url":"https://api.github.com/users/groovecoder/received_events","type":"User","site_admin":false},"body":"Just because I wanted to think about the single worst possible line of python ever:\r\n`if getattr(attrs.get('href', {}), 'value', ' ') == '/':`","created_at":"2015-09-04T14:09:28Z","updated_at":"2015-09-04T14:09:28Z","html_url":"https://github.com/mdn/browsercompat/pull/44#discussion_r38754823","pull_request_url":"https://api.github.com/repos/mdn/browsercompat/pulls/44","_links":{"self":{"href":"https://api.github.com/repos/mdn/browsercompat/pulls/comments/38754823"},"html":{"href":"https://github.com/mdn/browsercompat/pull/44#discussion_r38754823"},"pull_request":{"href":"https://api.github.com/repos/mdn/browsercompat/pulls/44"}}},"pull_request":{"url":"https://api.github.com/repos/mdn/browsercompat/pulls/44","id":44111708,"html_url":"https://github.com/mdn/browsercompat/pull/44","diff_url":"https://github.com/mdn/browsercompat/pull/44.diff","patch_url":"https://github.com/mdn/browsercompat/pull/44.patch","issue_url":"https://api.github.com/repos/mdn/browsercompat/issues/44","number":44,"state":"open","locked":false,"title":"bug 1198896 - Improve handling of <a> tags","user":{"login":"jwhitlock","id":286017,"avatar_url":"https://avatars.githubusercontent.com/u/286017?v=3","gravatar_id":"","url":"https://api.github.com/users/jwhitlock","html_url":"https://github.com/jwhitlock","followers_url":"https://api.github.com/users/jwhitlock/followers","following_url":"https://api.github.com/users/jwhitlock/following{/other_user}","gists_url":"https://api.github.com/users/jwhitlock/gists{/gist_id}","starred_url":"https://api.github.com/users/jwhitlock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwhitlock/subscriptions","organizations_url":"https://api.github.com/users/jwhitlock/orgs","repos_url":"https://api.github.com/users/jwhitlock/repos","events_url":"https://api.github.com/users/jwhitlock/events{/privacy}","received_events_url":"https://api.github.com/users/jwhitlock/received_events","type":"User","site_admin":false},"body":"* Convert MDN relative links to absolute links\r\n* Silently drop ``title`` attributes, ``class=external``, and ``class=external-icon``.\r\n* Allow <a> tags in specification description\r\n\r\nFixes about 100 [tag_dropped](https://browsercompat.herokuapp.com/importer/issues/tag_dropped) issues and 50 [unexpected_attribute](https://browsercompat.herokuapp.com/importer/issues/unexpected_attribute) issues.","created_at":"2015-09-03T14:13:47Z","updated_at":"2015-09-04T14:09:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"102a30e7808efe9b9bb0972d5cc647c0fb3d5c5f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mdn/browsercompat/pulls/44/commits","review_comments_url":"https://api.github.com/repos/mdn/browsercompat/pulls/44/comments","review_comment_url":"https://api.github.com/repos/mdn/browsercompat/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mdn/browsercompat/issues/44/comments","statuses_url":"https://api.github.com/repos/mdn/browsercompat/statuses/785a1af6064f9a10f4d56b5bb83fc9da35634c79","head":{"label":"mdn:improve_a_1181140","ref":"improve_a_1181140","sha":"785a1af6064f9a10f4d56b5bb83fc9da35634c79","user":{"login":"mdn","id":7565578,"avatar_url":"https://avatars.githubusercontent.com/u/7565578?v=3","gravatar_id":"","url":"https://api.github.com/users/mdn","html_url":"https://github.com/mdn","followers_url":"https://api.github.com/users/mdn/followers","following_url":"https://api.github.com/users/mdn/following{/other_user}","gists_url":"https://api.github.com/users/mdn/gists{/gist_id}","starred_url":"https://api.github.com/users/mdn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdn/subscriptions","organizations_url":"https://api.github.com/users/mdn/orgs","repos_url":"https://api.github.com/users/mdn/repos","events_url":"https://api.github.com/users/mdn/events{/privacy}","received_events_url":"https://api.github.com/users/mdn/received_events","type":"Organization","site_admin":false},"repo":{"id":21751920,"name":"browsercompat","full_name":"mdn/browsercompat","owner":{"login":"mdn","id":7565578,"avatar_url":"https://avatars.githubusercontent.com/u/7565578?v=3","gravatar_id":"","url":"https://api.github.com/users/mdn","html_url":"https://github.com/mdn","followers_url":"https://api.github.com/users/mdn/followers","following_url":"https://api.github.com/users/mdn/following{/other_user}","gists_url":"https://api.github.com/users/mdn/gists{/gist_id}","starred_url":"https://api.github.com/users/mdn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdn/subscriptions","organizations_url":"https://api.github.com/users/mdn/orgs","repos_url":"https://api.github.com/users/mdn/repos","events_url":"https://api.github.com/users/mdn/events{/privacy}","received_events_url":"https://api.github.com/users/mdn/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mdn/browsercompat","description":"API for browser compatibility data on developers.mozilla.org","fork":false,"url":"https://api.github.com/repos/mdn/browsercompat","forks_url":"https://api.github.com/repos/mdn/browsercompat/forks","keys_url":"https://api.github.com/repos/mdn/browsercompat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mdn/browsercompat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mdn/browsercompat/teams","hooks_url":"https://api.github.com/repos/mdn/browsercompat/hooks","issue_events_url":"https://api.github.com/repos/mdn/browsercompat/issues/events{/number}","events_url":"https://api.github.com/repos/mdn/browsercompat/events","assignees_url":"https://api.github.com/repos/mdn/browsercompat/assignees{/user}","branches_url":"https://api.github.com/repos/mdn/browsercompat/branches{/branch}","tags_url":"https://api.github.com/repos/mdn/browsercompat/tags","blobs_url":"https://api.github.com/repos/mdn/browsercompat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mdn/browsercompat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mdn/browsercompat/git/refs{/sha}","trees_url":"https://api.github.com/repos/mdn/browsercompat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mdn/browsercompat/statuses/{sha}","languages_url":"https://api.github.com/repos/mdn/browsercompat/languages","stargazers_url":"https://api.github.com/repos/mdn/browsercompat/stargazers","contributors_url":"https://api.github.com/repos/mdn/browsercompat/contributors","subscribers_url":"https://api.github.com/repos/mdn/browsercompat/subscribers","subscription_url":"https://api.github.com/repos/mdn/browsercompat/subscription","commits_url":"https://api.github.com/repos/mdn/browsercompat/commits{/sha}","git_commits_url":"https://api.github.com/repos/mdn/browsercompat/git/commits{/sha}","comments_url":"https://api.github.com/repos/mdn/browsercompat/comments{/number}","issue_comment_url":"https://api.github.com/repos/mdn/browsercompat/issues/comments{/number}","contents_url":"https://api.github.com/repos/mdn/browsercompat/contents/{+path}","compare_url":"https://api.github.com/repos/mdn/browsercompat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mdn/browsercompat/merges","archive_url":"https://api.github.com/repos/mdn/browsercompat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mdn/browsercompat/downloads","issues_url":"https://api.github.com/repos/mdn/browsercompat/issues{/number}","pulls_url":"https://api.github.com/repos/mdn/browsercompat/pulls{/number}","milestones_url":"https://api.github.com/repos/mdn/browsercompat/milestones{/number}","notifications_url":"https://api.github.com/repos/mdn/browsercompat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mdn/browsercompat/labels{/name}","releases_url":"https://api.github.com/repos/mdn/browsercompat/releases{/id}","created_at":"2014-07-11T21:25:57Z","updated_at":"2015-09-04T05:18:40Z","pushed_at":"2015-09-04T13:57:00Z","git_url":"git://github.com/mdn/browsercompat.git","ssh_url":"git@github.com:mdn/browsercompat.git","clone_url":"https://github.com/mdn/browsercompat.git","svn_url":"https://github.com/mdn/browsercompat","homepage":null,"size":3774,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":9,"forks":5,"open_issues":9,"watchers":3,"default_branch":"master"}},"base":{"label":"mdn:master","ref":"master","sha":"fdc12cbaaeded87c1d1662e2ae90afe6c973a596","user":{"login":"mdn","id":7565578,"avatar_url":"https://avatars.githubusercontent.com/u/7565578?v=3","gravatar_id":"","url":"https://api.github.com/users/mdn","html_url":"https://github.com/mdn","followers_url":"https://api.github.com/users/mdn/followers","following_url":"https://api.github.com/users/mdn/following{/other_user}","gists_url":"https://api.github.com/users/mdn/gists{/gist_id}","starred_url":"https://api.github.com/users/mdn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdn/subscriptions","organizations_url":"https://api.github.com/users/mdn/orgs","repos_url":"https://api.github.com/users/mdn/repos","events_url":"https://api.github.com/users/mdn/events{/privacy}","received_events_url":"https://api.github.com/users/mdn/received_events","type":"Organization","site_admin":false},"repo":{"id":21751920,"name":"browsercompat","full_name":"mdn/browsercompat","owner":{"login":"mdn","id":7565578,"avatar_url":"https://avatars.githubusercontent.com/u/7565578?v=3","gravatar_id":"","url":"https://api.github.com/users/mdn","html_url":"https://github.com/mdn","followers_url":"https://api.github.com/users/mdn/followers","following_url":"https://api.github.com/users/mdn/following{/other_user}","gists_url":"https://api.github.com/users/mdn/gists{/gist_id}","starred_url":"https://api.github.com/users/mdn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdn/subscriptions","organizations_url":"https://api.github.com/users/mdn/orgs","repos_url":"https://api.github.com/users/mdn/repos","events_url":"https://api.github.com/users/mdn/events{/privacy}","received_events_url":"https://api.github.com/users/mdn/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mdn/browsercompat","description":"API for browser compatibility data on developers.mozilla.org","fork":false,"url":"https://api.github.com/repos/mdn/browsercompat","forks_url":"https://api.github.com/repos/mdn/browsercompat/forks","keys_url":"https://api.github.com/repos/mdn/browsercompat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mdn/browsercompat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mdn/browsercompat/teams","hooks_url":"https://api.github.com/repos/mdn/browsercompat/hooks","issue_events_url":"https://api.github.com/repos/mdn/browsercompat/issues/events{/number}","events_url":"https://api.github.com/repos/mdn/browsercompat/events","assignees_url":"https://api.github.com/repos/mdn/browsercompat/assignees{/user}","branches_url":"https://api.github.com/repos/mdn/browsercompat/branches{/branch}","tags_url":"https://api.github.com/repos/mdn/browsercompat/tags","blobs_url":"https://api.github.com/repos/mdn/browsercompat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mdn/browsercompat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mdn/browsercompat/git/refs{/sha}","trees_url":"https://api.github.com/repos/mdn/browsercompat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mdn/browsercompat/statuses/{sha}","languages_url":"https://api.github.com/repos/mdn/browsercompat/languages","stargazers_url":"https://api.github.com/repos/mdn/browsercompat/stargazers","contributors_url":"https://api.github.com/repos/mdn/browsercompat/contributors","subscribers_url":"https://api.github.com/repos/mdn/browsercompat/subscribers","subscription_url":"https://api.github.com/repos/mdn/browsercompat/subscription","commits_url":"https://api.github.com/repos/mdn/browsercompat/commits{/sha}","git_commits_url":"https://api.github.com/repos/mdn/browsercompat/git/commits{/sha}","comments_url":"https://api.github.com/repos/mdn/browsercompat/comments{/number}","issue_comment_url":"https://api.github.com/repos/mdn/browsercompat/issues/comments{/number}","contents_url":"https://api.github.com/repos/mdn/browsercompat/contents/{+path}","compare_url":"https://api.github.com/repos/mdn/browsercompat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mdn/browsercompat/merges","archive_url":"https://api.github.com/repos/mdn/browsercompat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mdn/browsercompat/downloads","issues_url":"https://api.github.com/repos/mdn/browsercompat/issues{/number}","pulls_url":"https://api.github.com/repos/mdn/browsercompat/pulls{/number}","milestones_url":"https://api.github.com/repos/mdn/browsercompat/milestones{/number}","notifications_url":"https://api.github.com/repos/mdn/browsercompat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mdn/browsercompat/labels{/name}","releases_url":"https://api.github.com/repos/mdn/browsercompat/releases{/id}","created_at":"2014-07-11T21:25:57Z","updated_at":"2015-09-04T05:18:40Z","pushed_at":"2015-09-04T13:57:00Z","git_url":"git://github.com/mdn/browsercompat.git","ssh_url":"git@github.com:mdn/browsercompat.git","clone_url":"https://github.com/mdn/browsercompat.git","svn_url":"https://github.com/mdn/browsercompat","homepage":null,"size":3774,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":9,"forks":5,"open_issues":9,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mdn/browsercompat/pulls/44"},"html":{"href":"https://github.com/mdn/browsercompat/pull/44"},"issue":{"href":"https://api.github.com/repos/mdn/browsercompat/issues/44"},"comments":{"href":"https://api.github.com/repos/mdn/browsercompat/issues/44/comments"},"review_comments":{"href":"https://api.github.com/repos/mdn/browsercompat/pulls/44/comments"},"review_comment":{"href":"https://api.github.com/repos/mdn/browsercompat/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mdn/browsercompat/pulls/44/commits"},"statuses":{"href":"https://api.github.com/repos/mdn/browsercompat/statuses/785a1af6064f9a10f4d56b5bb83fc9da35634c79"}}}}