{"action":"created","issue":{"url":"https://api.github.com/repos/ampproject/amphtml/issues/994","labels_url":"https://api.github.com/repos/ampproject/amphtml/issues/994/labels{/name}","comments_url":"https://api.github.com/repos/ampproject/amphtml/issues/994/comments","events_url":"https://api.github.com/repos/ampproject/amphtml/issues/994/events","html_url":"https://github.com/ampproject/amphtml/issues/994","id":118427581,"number":994,"title":"Clarify the documentation for allowed attributes","user":{"login":"uncompiled","id":408989,"avatar_url":"https://avatars.githubusercontent.com/u/408989?v=3","gravatar_id":"","url":"https://api.github.com/users/uncompiled","html_url":"https://github.com/uncompiled","followers_url":"https://api.github.com/users/uncompiled/followers","following_url":"https://api.github.com/users/uncompiled/following{/other_user}","gists_url":"https://api.github.com/users/uncompiled/gists{/gist_id}","starred_url":"https://api.github.com/users/uncompiled/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uncompiled/subscriptions","organizations_url":"https://api.github.com/users/uncompiled/orgs","repos_url":"https://api.github.com/users/uncompiled/repos","events_url":"https://api.github.com/users/uncompiled/events{/privacy}","received_events_url":"https://api.github.com/users/uncompiled/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-23T17:14:05Z","updated_at":"2015-11-23T18:40:42Z","closed_at":null,"body":"It would be helpful to clarify the allowed attributes for whitelisted elements.  This would help publishers avoid validation errors when transforming content from their content management systems.\r\n\r\nThere is already a HTML5 element whitelist in the [AMP Tag Addendum](https://github.com/ampproject/amphtml/blob/master/spec/amp-tag-addendum.md), but there isn't a clear reference for the attributes that are allowed vs. prohibited by the AMP spec.\r\n\r\nThere is some documentation in the form of the [validator](https://github.com/ampproject/amphtml/blob/master/validator/validator.protoascii), but the validator might not be the most accessible format for all users."},"comment":{"url":"https://api.github.com/repos/ampproject/amphtml/issues/comments/159023516","html_url":"https://github.com/ampproject/amphtml/issues/994#issuecomment-159023516","issue_url":"https://api.github.com/repos/ampproject/amphtml/issues/994","id":159023516,"user":{"login":"Gregable","id":25519,"avatar_url":"https://avatars.githubusercontent.com/u/25519?v=3","gravatar_id":"","url":"https://api.github.com/users/Gregable","html_url":"https://github.com/Gregable","followers_url":"https://api.github.com/users/Gregable/followers","following_url":"https://api.github.com/users/Gregable/following{/other_user}","gists_url":"https://api.github.com/users/Gregable/gists{/gist_id}","starred_url":"https://api.github.com/users/Gregable/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gregable/subscriptions","organizations_url":"https://api.github.com/users/Gregable/orgs","repos_url":"https://api.github.com/users/Gregable/repos","events_url":"https://api.github.com/users/Gregable/events{/privacy}","received_events_url":"https://api.github.com/users/Gregable/received_events","type":"User","site_admin":false},"created_at":"2015-11-23T18:40:42Z","updated_at":"2015-11-23T18:40:42Z","body":"I think what I'd like to do is generate some code which will take the validator's [spec](https://github.com/ampproject/amphtml/blob/master/validator/validator.protoascii) file and produce some markdown from it that is more human readable. \r\n\r\nFor example, the section regarding the `<meta>` tag in the validator reads:\r\n```\r\n# 4.2.5 the meta element\r\n# Charset must be utf8, and a specific viewport is required.\r\n# Other meta elements not supported.\r\ntags: {\r\n  name: \"meta\"\r\n  mandatory: true\r\n  mandatory_parent: \"head\"\r\n  unique: true\r\n  detail: \"charset utf-8 declaration\"\r\n  spec_url: \"https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#chrs\"\r\n  attrs: {\r\n    name: \"charset\"\r\n    mandatory: true\r\n    value: \"utf-8\"\r\n  }\r\n}\r\ntags: {\r\n  name: \"meta\"\r\n  detail: \"viewport declaration\"\r\n  mandatory: true\r\n  mandatory_parent: \"head\"\r\n  unique: true\r\n  spec_url: \"https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#vprt\"\r\n  attrs: {\r\n    name: \"name\"\r\n    mandatory: true\r\n    value: \"viewport\"\r\n  }\r\n  attrs: {\r\n    name: \"content\"\r\n    mandatory: true\r\n    value_properties: {\r\n      properties: { name: \"width\" mandatory: true value: \"device-width\" }\r\n      properties: { name: \"height\" }\r\n      properties: { name: \"initial-scale\" }\r\n      properties: { name: \"minimum-scale\" mandatory: true value_double: 1.0 }\r\n      properties: { name: \"maximum-scale\" }\r\n      properties: { name: \"user-scalable\" }\r\n    }\r\n  }\r\n}\r\ntags: {\r\n  name: \"meta\"\r\n  attrs: {\r\n    name: \"property\"\r\n    mandatory: true\r\n  }\r\n  attrs: {\r\n    name: \"content\"\r\n    mandatory: true\r\n  }\r\n}\r\n# The validator accepts any name=\"...\" content=\"...\" attribute pair except\r\n# for a few specific name values which have more specific rules above or\r\n# are altogether disallowed.\r\ntags: {\r\n  name: \"meta\"\r\n  attrs: {\r\n    name: \"name\"\r\n    mandatory: true\r\n    blacklisted_value_regex: \"viewport|content-disposition|revisit-after\"\r\n  }\r\n  attrs: {\r\n    name: \"content\"\r\n    mandatory: true\r\n  }\r\n}\r\n```\r\n\r\nAnd could be converted to markdown to look something like:\r\n\r\n>4.2.5 `<meta>` \r\n>\r\n>There are 2 mandatory `meta` tags\r\n>\r\n>  1. charset utf-8 declaration\r\n>    - mandatory attribute `charset`, value `utf-8`\r\n>    - There may be only one of these tags.\r\n>    - This tag's parent must be a `<head>` tag.\r\n>    - [Spec Reference](https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#chrs)\r\n>  2. viewport declaration\r\n>    -  mandatory attribute `name`, value `viewport`\r\n>    -  mandatory attribute `content`, value is a list of properties:\r\n>        - mandatory name `width`, value `device-width`\r\n>        - mandatory name `maximum-scale`, value `1.0`\r\n>        - optional name `height`, any value\r\n>        - optional name `initial-scale`, any value\r\n>        - optional name `maximum-scale`, any value\r\n>        - optional name `user-scalable`, any value\r\n>    - There may be only one of these tags.\r\n>    - This tag's parent must be a `<head>` tag.\r\n>    - [Spec Reference](https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#vprt)\r\n>\r\n>There are 2 optional `meta` tags variants:\r\n>\r\n>  1. <unnamed>\r\n>    - mandatory attribute `property`, any value\r\n>    - mandatory attribute `content`, any value\r\n>  2. <unnamed>\r\n>    - mandatory attribute `name`, value must match the regex `viewport|content-disposition|revisit-after`\r\n>    - mandatory attribute `content`, any value\r\n\r\nThis is currently just an example done by hand. The Tag addendum was an attempt to do the same (also by hand) before folks had access to the validator spec file. I think we should write some code to generate this automatically from the spec file, however.\r\n\r\n\r\n"}}