5 ms·
You don't need the quotes in many cases. Instead of: <link rel="icon" href="data:,"> Try <link rel=icon href="data:,">
by dna_polymerase 4y ago
You don't need the quotes in many cases.
Instead of:
<link rel="icon" href="data:,">
Try
<link rel=icon href="data:,">
- thegeekpirate 4y ago<link href=data: rel=icon> will work just fine ;) Another fun trick is using <!doctypehtml> since the spec says to pretend a space is there if not present for whatever reason (https://html.spec.whatwg.org/multipage/parsing.html#parse-error-missing-whitespace-before-doctype-name https://html.spec.whatwg.org/multipage/parsing.html#parse-er...)
- tomcam 4y agoWell damn. That is an oddity.
- skyfaller 4y agoCute, but I just ran both your suggestions through the HTML validator at https://validator.w3.org/nu/ https://validator.w3.org/nu/ and neither of them validated. The first error read "Bad value data: for attribute href on element link: Premature end of URI." The 2nd error read "Missing space before doctype name." Depending on the context these hacks may still be useful, but I personally think that both production sites and code golfing should require valid HTML.
- dna_polymerase 4y agoI run this in prod. Never had an issue with it.
- thegeekpirate 4y agoYou can't use the error handling part of the spec without invoking an error. Good minifiers will do the same, fwiw.