Whitelist custom HTML elements in the AMP project

I work on the AMP HTML project, which has custom HTML element names such as "amp-img", "amp-install-serviceworker" or "amp-video". WebStorm highlights these as "Unknown HTML tag".

Is there a way to define and share a list of valid AMP HTML elements (based on https://github.com/ampproject/amphtml/tree/master/extensions) ? This is not an XML situation, and adding Unknown HTML tags (alongside nobr,noembed etc.) or attributes individually to the inspection is a poor solution because we can't easily share those with other developers in the project's source repo.

1 comment

the only way to have AMD tags/attributes accepted is adding them to 'Custom HTML tag' and 'Custom HTML tag attributes' lists in Settings | Editor | Inspections | HTML, Unknown HTML tag and  Unknown HTML tag attribute. Tags/attributes listed there are not highlighted as warnings and are suggested by completion.

You can do this by hitting Alt+Enter on each of tags/attributes errors is reported for and choosing 'Add to custom HTML tags (tag attributes)' from the popup


Please sign in to leave a comment.