Re: Formatting ASP.NET code

* Tommi wrote:
>It want's me to specify each ASP.NET control type as it's own tag:
>asp:literal asp:placeholder and so on. Now for some weird reason all of 
>the asp tags I have inside the documents <head></head> portion get moved 
>inside the <body></body> tag after tidying. Am I missing something?

The problem here is that HTML 4.01 is defined so that any element that
is not defined to be allowed inside <head> causes the <head> element to
be closed, the body element be opened and then processed, i.e.

  <head><title>...</title><unknown>...

would be processed as if it were

  <head><title>...</title></head>
  <body><unknown>...

Tidy does not know that your custom elements are allowed inside <head>
so it assumes they are not. So Tidy behaves as designed. We could make
a new configuration option to state which elements are allowed inside
<head> to solve this. We could also make it so that Tidy looks whether
there is a following </head> and assume that </head> is not misplaced,
but that would require major changes to the code. Do you have anything
else in mind to solve this problem?

Received on Wednesday, 14 July 2004 18:25:29 UTC