{"action":"opened","issue":{"url":"https://api.github.com/repos/cure53/DOMPurify/issues/272","repository_url":"https://api.github.com/repos/cure53/DOMPurify","labels_url":"https://api.github.com/repos/cure53/DOMPurify/issues/272/labels{/name}","comments_url":"https://api.github.com/repos/cure53/DOMPurify/issues/272/comments","events_url":"https://api.github.com/repos/cure53/DOMPurify/issues/272/events","html_url":"https://github.com/cure53/DOMPurify/issues/272","id":306904939,"number":272,"title":"Tag specific attributes","user":{"login":"ssylvia","id":1211360,"avatar_url":"https://avatars3.githubusercontent.com/u/1211360?v=4","gravatar_id":"","url":"https://api.github.com/users/ssylvia","html_url":"https://github.com/ssylvia","followers_url":"https://api.github.com/users/ssylvia/followers","following_url":"https://api.github.com/users/ssylvia/following{/other_user}","gists_url":"https://api.github.com/users/ssylvia/gists{/gist_id}","starred_url":"https://api.github.com/users/ssylvia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ssylvia/subscriptions","organizations_url":"https://api.github.com/users/ssylvia/orgs","repos_url":"https://api.github.com/users/ssylvia/repos","events_url":"https://api.github.com/users/ssylvia/events{/privacy}","received_events_url":"https://api.github.com/users/ssylvia/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-20T15:02:44Z","updated_at":"2018-03-20T15:02:44Z","closed_at":null,"author_association":"NONE","body":"It looks like `ALLOWED_ATTR` is global to all tags. Is there anyway to whitelist attributes specific to a tags, something similar to [js-xss whitelist](https://github.com/leizongmin/js-xss#whitelist)? For example, we could do something like:\r\n\r\nvar clean = DOMPurify.sanitize(dirty, {\r\n  ALLOWED_TAGS: {\r\n    'a': ['href', 'target'],\r\n    'div': ['class']\r\n    'strong': [],\r\n  }\r\n});\r\n\r\nWhen the array is empty, the tag would be allowed but strip all attributes.\r\n"}}
{"actor":{"display_login":"ssylvia"}}