Bugzilla – Bug 628
Warn about unquoted attributes for some attributes
Last modified: 2015-04-01 09:40:50 CEST
Issue warnings when an attribute not listed below appears in unquoted form:
<progress value max>
<meter value min low high max optimum>
<img width height>
<iframe width height>
<embed width height>
<object width height>
<video width height>
<canvas width height>
<area shape hreflang>
<td colspan rowspan>
<th colspan rowspan scope>
<form autocomplete enctype method>
<input autocomplete formenctype formmethod height max maxlength min size
step type width>
<button formenctype formmethod>
<textarea cols maxlength rows wrap>
I think xmlns and xmlns:xlink should be in the list, too, come to think of it.
FWIW, latest MediaWiki will now allow outputting unquoted attributes anywhere they're allowed, making sure that it's safe. E.g., it will happily do things like
which would of course trigger this warning. This is totally safe, though, since the quotes are added if any invalid characters are present, and it would be annoying if it spammed warnings everywhere for no good reason. The warning only really makes sense (arguably) for hand-written documents, or poorly-written applications.
I think that by now it is safe to say that
a. There is a demand for this feature or something similar. The HTML5 "superfriends" wants polyglot checking capabilities, but I'd presume for basically the same reasons as I initiated the debate that led to S P filing this bug.
b. There is a strong sentiment that such warnings should be optional.
(BTW, While mediawiki has back-end processing to ensure that quotation marks get inserted when needed, it might be that some other developers chose to go down another route.)