[whatwg] HTML 5: The l (line) element

Ian Hickson ian at hixie.ch
Wed Apr 23 00:14:22 PDT 2008

On Sun, 17 Feb 2008, Dave Hodder wrote:
> Please consider adding the 'l' element (as found in XHTML 2).
> The 'l' element can be used to break up text into separate lines, in a 
> similar manner to the existing 'br' element.  Unlike 'br', it is a 
> container element; instead of "<p>Line 1<br>Line 2</p>", one would type 
> "<p><l>Line 1</l><l>Line 2</l></p>".  The main advantage of 'l' is 
> presentational -- it becomes much easier to colour lines differently, to 
> add automatic line numbers, etc.

While I understand your request, I don't think the use cases you raise are 
really compelling enough reasons to add a new element to do this. <br> 
works, and people have already proposed ways to extend CSS to do 
line-by-line styling that would work without an explicit line element.

On Tue, 19 Feb 2008, Christoph Päper wrote:
> We could also consider to reuse |br| for this purpose and thus make it 
> magic, i.e. it is empty by default and works like it has always done, 
> but if "</br>" is encountered it turns the preceding "<br...>" (but not 
> "<br.../">) on the same nesting level from an empty into a start tag. 
> (If there is no start tag, it is an authoring mistake.) In XHTML5 this 
> would be easy. One problem of this idea is the backwards compatibility 
> for the first line, because |br| traditionally generates a line break 
> immediately, i.e. before not after the logical line.
>   <br>first line</br>
>   <br>second line</br>
>   ...
>   <br>n-1th line</br>
>   <br>nth line</br>
> becomes in current implementations
>   zeroth line<br>
>   first line<br>
>   second line<br>
>   ...
>   n-1th line<br>
>   nth line
> Another problem are multiple (adjacent) empty/start tags, where you 
> probably would have to disallow nesting of lines to describe current 
> rendering of multiple (consecutive) line breaks, which is not conformant 
> with HTML4.

Actually it's worse, </br> is actually handled as <br> in browsers, so 
you'd end up with blank lines if we did this.

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

More information about the whatwg mailing list