3 ms·
Cute, 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
by skyfaller 4y ago
Cute, 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.