[whatwg] Allow trailing slash in always-empty HTML5 elements?
Anne van Kesteren
annevk at opera.com
Wed Nov 29 08:42:21 PST 2006
On Wed, 29 Nov 2006 17:37:52 +0100, Sam Ruby <rubys at intertwingly.net>
>> The bug would request that Wordpress doesn't try to output XML for the
>> text/html media type. That seems to be the problem here.
> If the code for Wordpress fit on a page, that suggestion would be easy
> to implement.
> As it stands now, it appear that several hundred lines of code would
> need to change. And in each case, the code would need to be aware of
> the content type in effect. In some cases, that information may not be
> available. In fact, that may not have been determined yet.
Why would the code need to be aware of that? Atom supports type="html".
> One way cross-cutting concerns such as this one are often handled is to
> simple capture the output and post-process it. Latchlan opted to do so
> with the WHATWG Blog. The first pass for things like this generally
> takes the form of simple pattern matching and regular expressions.
The solution used on the blog was a simple find (/>) and replace (>).
> Often this evolves. What would be better is something that could take
> that string and produce a DOM, from which a correct serialization can
> take place.
Shouldn't this be done throughout the code instead of at the end?
> Now, what type of parser would you use? HTML5's rules come
> tantalizingly close to handling this situation, except for a few cases
> involving tags that are self-closing...
Those cases are covered as well. You seem to think that "parse error"
means the same as it does in XML or something. It does not. It merely
means there's a syntax error and that you can continue parsing following
the specified rules.
Anne van Kesteren
More information about the whatwg