Inline Lists

View: New views
4 Messages — Rating Filter:   Alert me  

Inline Lists

by Ryan Roberts-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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.

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.

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?

Thanks,
Ryan


Web Designer & Developer
hello@...
07759917964






Re: Inline Lists

by ownedthx :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hey Ryan,

I'd like to jump in on this as well.  This is a problem not just with  
lists, but that is a good example.

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.

Let's for a second assume  the HTML5 spec were to make a change here.  
If that were to happen, the CSS 'display' value 'inline-block' could  
offer inspiration for terminology, and behavior, for this situation.  
Perhaps something like, 'if a block element occurs within phrasing  
content, it would cause content model to reset to flow content  
underneath that block element'.

Regards,
Seth





On Jul 26, 2009, at 2:39 PM, 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.
>
> 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.
>
> 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?
>
> Thanks,
> Ryan
>
>
> Web Designer & Developer
> hello@...
> 07759917964
>
>
>
>
>



Re: Inline Lists

by Ian Hickson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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.   `._.-(,_..'--(,_..'`-.;.'


Re: Inline Lists

by Ryan Roberts-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 3 Aug 2009, at 11:52, Ian Hickson wrote:

> On Sun, 26 Jul 2009, Ryan Roberts wrote:
>> 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?

That it is a list (ordered or unordered), but within another element.

>
>
>> 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.
>

Ah ok I wasn't aware it had already been suggested, and yes I can  
imagine it being complicated especially with backward compatibility.

>
> 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.   `._.-(,_..'--
> (,_..'`-.;.'


Web Designer & Developer

http://ryanroberts.co.uk
hello@...
07759917964