Open annevk opened 6 years ago
I'm still not entirely sure it's short enough. E.g. what would you write for the various bullets in https://mimesniff.spec.whatwg.org/#mime-type-groups ? Would it be e.g.
? That seems kind of tedious :-/.
The only alternative I can think of is to just say that when you write the MIME type without quotes, it's a representation of a MIME type record. Maybe you could even use a different font style, e.g. italic-monospace, or non-monospace plain, or something like that.
Oh, you want to go even further. Hmm, maybe something like <a lt="MIME type literal"><code>text/html</code></a>
? So when you follow the link it's defined what it means? (I'd probably define it as taking the value and putting it in the parser...)
Well, but I kind of like how in HTML these MIME types currently link to their actual definitions, e.g. https://html.spec.whatwg.org/#text/html
Fair, although the whole IANA thing is rather messy. So how about we require MIME type the term to be mentioned nearby the literals? Or even stricter, that it's unambiguous the literal is a MIME type literal (and then define how you extract a MIME type record from such a literal).
That, coupled with ensuring there are no quotes, seems reasonable. Still monospace though, is the plan?
FWIW I think we should try to disallow writing e.g. TEXT/Html
, even though that will parse correctly. So a definition in terms of the parser isn't the whole story, I think.
Yeah, <code>
. I suppose we could define some custom ABNF for specifications to conform to, but...
Writing
is rather tedious. We could make something like
mean the same thing. At least, I don't think we want to have a
<dfn>
for each MIME type.XMLHttpRequest would use it. I'm pretty sure HTML would. This standard would use it. Fetch would use it.
I initially compared this with URLs, but needing a macro for a unique URL is much more rare.