[whatwg] <p> elements containing other block-level elements

On Fri, 8 Apr 2005, Matthew Thomas wrote:
> 
> <p>It makes sense to allow bulleted/numbered lists inside paragraphs, for two
> reasons:<ul>
> <li>such lists are already used in typography</li>
> [see below]
> </ul>But as for inline lists, I think creating markup for them would be a
> waste of time.</p>

Agreed.


> <li>they would have acceptable presentation in UAs that claim HTML4
>     support.</li>

Even in HTML5 UAs, in the HTML parser this:

   <p><ul><li></li></ul></p>

...will become this:

   <p></p><ul><li></li></ul>

That's part of the problems. To get truly nested elements, only the XML 
parser would be an option. (Well, that or a scripted solution that poked 
the elements into the DOM in the right place.)

The question is whether:

 a) We don't allow any of this.

 b) We allow it in XML and the DOM but disallow it in the HTML 
    serialisation

 c) We allow it in XML and the DOM and say that authors may do it in HTML
    but that parsers must (effectively) misunderstand them

 d) We allow it in XML and the DOM and say that authors may use the 
    <object> hack to us it in HTML

I don't see any other realistic options. I don't like c. I'm reluctant to 
do a. For me, that leaves b and d.

Of b and d I prefer b. That, along with embedding MathML and other XML 
vocabularies, would be a reason to migrate to XML, if we consider that a 
good thing.

At the end of the day this would just be saying "in XML you can also do 
this". Avoiding those options for people who serialise to both XML and 
HTML is relatively easy, just like avoiding xml:base and MathML.


> The content model for any block element allowed inside paragraphs should 
> be tweaked to not allow paragraphs when it's inside a paragraph, because 
> nested paragraphs don't make sense.

Agreed. (Including inside nested <tables> and <li>s, I assume? But 
obviously excluding inside nested <blockquote>s.)

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Friday, 8 April 2005 03:27:33 UTC