Re: Inline Lists

On Sun, 26 Jul 2009, Ryan Roberts wrote:
>
> I came across a problem recently while trying to markup a list within a 
> paragraph. Here's an example:
> 
> - Today I went to the local store and bought; cheese, bread, milk, eggs 
> and a tin of spam. When I got home I found the eggs were rotten and the 
> bread was green!
> 
> Here we have an inline list within a paragraph, something I would guess 
> to be quite common.

Yup. No need for any special markup in this case, though, as far as I can 
tell.


> It would not be appropriate to break out into a block level list 
> surrounded by two separate paragraphs. Using CSS is also out of the 
> question because I would then have to embed the list element within the 
> paragraph. I suppose I could use the b element to set the list text off 
> from the surrounding text but this doesn't convey the correct semantic 
> information.

What is the "correct semantic information" to be used for in this case?


> Has a solution for this ever been considered in HTML?  If it has been 
> considered is there anything I can read covering why it wasn't accepted?

We did originally have <ol> allowed in <p>, but it turns out to be a can 
of worms with a number of complications. The most important problems were 
that it makes editors harder to write, it is incompatible with legacy HTML 
parsing rules, and it makes the content models really complicated.


On Sun, 26 Jul 2009, Seth Call wrote:
> 
> The HTML5 spec has a semi-solution, in that it is suggested that when 
> you omit the p tags, there are in effect 'implicit paragraphs'.  Check 
> out the last example of this section, 
> http://dev.w3.org/html5/spec/dom.html#paragraph, (the one about 'My 
> Cats').  While that example is a clever way of thinking of the data, 
> ultimately I don't think this is a workable solution, because it is 
> impossible to know for sure that the text on either side of the block 
> element is actually related.

It's not really intended to be a solution, that's just something that I 
had to define because otherwise there's no clear definition of what that 
text actually is.

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

Received on Monday, 3 August 2009 10:53:21 UTC