Lullabot / amp-library

Convert HTML to AMP HTML and report HTML compliance with the AMP HTML specification
Other
382 stars 181 forks source link

Error when converting anchors with type attribute #167

Open garlab opened 7 years ago

garlab commented 7 years ago

Hi,

I'm working with a CMS generating links like this:

<a href="file.xls" type="application/vnd.ms-excel; length=71680">download</a>

When I try to convert that file I get:

<a href="file.xls" type="application/vnd.ms-excel; length=71680"> on line 1
 - The attribute 'type' in tag 'a' is set to the invalid value 'application/vnd.ms-excel; length=71680'.
   [code: INVALID_ATTR_VALUE  category: DISALLOWED_HTML]

However this seems to be a valid attribute, according to MDN:

type
  Specifies the media type in the form of a MIME type for the linked URL. This is provided strictly as advisory information; there is no built-in behavior for it.

Shouldn't the library just remove the type attribute without raising any error?

SGudbrandsson commented 7 years ago

@garlab good point. We'll look into improving this, thanks. :)