Re: Tidy strips <center> tags within <p> tags

"Fred Bone" <[email protected]>
Newsgroups gmane.comp.web.html-tidy.user
Message-ID <[email protected]>
On 2 Oct 2006 at 11:52, Richard A. O'Keefe said:

> 
> Cory Nelson (hope I've got that right) wrote:
>     vvvvvvvvvv
>  > <center> is not valid within <p>.
>            ^^^^^^^^^^
> 
> "Fred Bone" <[email protected]> replied:
>  <center> *is* valid for (X)HTML Transitional, ...
> 
> Valid, yes.  But not valid within <p>.
> <p> may only contain %inline content,
> and <center> is %block level content, NOT %inline content.

I suppose it depends on your (or Tidy's) interpretation of "within".
In my view, what
 <p>aaaa<center>bbbb</center>cccc</p>
really means is
 <p>aaaa</p><center>bbbb</center><p>cccc</p>
and I would expect Tidy to change it to that (or something close), rather 
than to
 <p>aaaa bbbb cccc</p>
which is what it seems to do with the equivalent(*) <div align="center">

Provided, of course, that you haven't told it the input is (X)HTML 
Strict, in which context <center> has no meaning at all.

(*) The HTML4x specs describe <center> as "shorthand for DIV 
align=center"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.