amp-library
amp-library copied to clipboard
Error when converting anchors with type attribute
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 good point. We'll look into improving this, thanks. :)