amp-library icon indicating copy to clipboard operation
amp-library copied to clipboard

Error when converting anchors with type attribute

Open garlab opened this issue 8 years ago • 1 comments

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?

garlab avatar Feb 13 '17 13:02 garlab

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

SGudbrandsson avatar Mar 14 '17 13:03 SGudbrandsson