[Haskell-cafe] ANNOUNCE: Haddock version 2.8.0

Jeremy Shaw jeremy at n-heptane.com
Sat Sep 4 21:27:28 EDT 2010


On Thu, Sep 2, 2010 at 11:14 PM, Mark Lentczner <markl at glyphic.com> wrote:
> I am well aware of the differences between HTML and XHTML.
>
> I choose to switch Haddock's output from HTML to XHTML mostly because I have found the consistency of rendering cross-browser to be greater and easier to achieve with XHTML. I'm not alone in this opinion: Many well respected web design authorities have promoted, and publish their own sites, in XHTML.[1] Even Microsoft's own developer web site uses it[2]!

I am very glad for the new CSS based layout! Thanks!

I am very dubious that switching from HTML to XHTML makes anything
more consistent. If you have a counter example I would love to see it,
because this is an issue that affects my daily work.

Here is why I am dubious. Browsers that support html and xhtml have
two different code paths for rending html vs xhtml. The *only* way to
select which code path is taken is by specifying the mime-type when
you serve it. Either application/xml or text/html.

So, if you take xhtml and serve it as text/html, then the browser will
treat it as html and send it to the html code rendering path. In other
words, it will send it down a code path that knows nothing about
xhtml.

The reason it works at all is because browsers do their darnest to
make it render. So in xhtml you might have a tag like:

 <br />

Which, in xhtml, is short for <br></br>.

When you send it down the html path, it the html render will see it as:

 <br / >

That is, it will see it as the normal <br> tag with a bogus attribute named /.

Now, perhaps you can understand why I am dubious? Whether or not you
send html or xhtml, it is being rendered by the same code that only
understands html. So it is hard to see how adding bogus attributes
like / to elements is going to improve cross browser compatibility.
You are basically saying that if you add bogus markup to your html
that the browser ignores, it is works more reliably than producing
valid html. The fact that the bogus markup happens to make it valid
xhtml is unimportant, because the code path knows nothing of xhtml
anyway.

If you converted the current code from xhtml to html, and anything
changes in the rendering, I, for one, will be shocked, and very
curious about why that happened.

Also, if you plan to eventually migrate to the x/html 5, that spec says:

 "generally speaking, authors are discouraged from trying to use XML on the Web"

Since the Web Hypertext Application Technology Working Group is full
of people that actually develop browsers, I think their opinion
carries some weight ;)

Anyway, I expect the use of xhtml (served as text/html) instead of
valid html in haddock will have no negative effects for me whatsoever.
But the use of CSS will be a big win! So thanks again for doing that!

- jeremy


More information about the Haskell-Cafe mailing list