Well, there are specs and then there's actual practice. Believe me, I've read every passage of the specs you've quoted, numerous times. But let's face it -- the most common user agent out there is the browser, and browsers have had to go to great lengths to accept and properly handle really bad HTML, far worse than what we're discussing here, so what Yaws has been producing via ehtml has been good enough to work pretty well in practice.
That is actually not correct! This is what the XHTML spec says on the
4.6. Empty Elements
Empty elements must either have an end tag or the start tag must end
with />. For instance, <br/> or <hr></hr>. See HTML Compatibility
Guidelines <http://www.w3.org/TR/xhtml1/#guidelines> for information on
ways to ensure this is backward compatible with HTML 4 user agents.
HTML Compatibility guidelines
C.2. Empty Elements
Include a space before the trailing / and > of empty elements, e.g. <br
/>, <hr /> and <img src="karen.jpg" alt="Karen" />. Also, use the
minimized tag syntax for empty elements, e.g. <br />, as the alternative
syntax <br></br> allowed by XML gives uncertain results in many existing
C.3. Element Minimization and Empty Element Content
Given an empty instance of an element whose content model is not EMPTY
(for example, an empty title or paragraph) do not use the minimized form
(e.g. use <p> </p> and not <p />).
And from the XHTML DTD (both STRICT and TRANSITIONAL we can see that :
<!ELEMENT input EMPTY> <!-- form control -->
So XHTML spec's recommendation is to actually USE <input ... /> with a
space before the '/>' to ensure compatibility
For HTML 4.01 STRICT an end tag is forbidden and older HTML specs never
specified the end tag either
From: Steve Vinoski [mailto:firstname.lastname@example.org]
Sent: Tuesday, July 28, 2009 12:34 PM
To: Garrett Smith
Cc: Yaws List
Subject: Re: [Erlyaws-list] input tag being closed
On Sat, Jul 25, 2009 at 8:29 PM, Steve Vinoski <email@example.com> wrote:
Garrett and I had an offline conversation about this because at
first I didn't see the issue, but he reminded me that in HTML the input
tag officially has no closing tag (sad but true). I don't think it's
really a problem in practice, given the huge amount of bad HTML out
there that browsers have to compensate for, but we should probably fix
this to make Yaws correct in this regard. I'll go ahead and fix it
unless someone knows of a good reason not to change it?
Replying to myself, I've gotten some private email stating concerns
about changing this, primarily because it would disallow the output from
being treated as XHTML or anything else besides strict HTML 4.01. I
think that's a valid concern, so perhaps the best course of action
really is to just leave it alone.