[whatwg] [html5] r6088 - [e] (0) clarification Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=12165

Ian Hickson ian at hixie.ch
Fri Sep 9 15:46:56 PDT 2011

On Sat, 10 Sep 2011, Shaun Moss wrote:
> On the contrary, I've often seen <pre> used with <code> to mark up 
> pre-formatted code. If you leave out the <code> tag then you've removed 
> the semantics of the content, plus some source-code highlighting 
> libraries look specifically for <code> tags. If the <pre> tag is left 
> out and CSS is used to style code elements as pre-formatted, without CSS 
> classes this interferes with marking up code inline.

The spec now says to use both.

> However, (perhaps tangential to the topic) as far as I know there are no 
> rules to say whether the <pre> tags should wrap the <code> tags or 
> vice-versa.

<pre> isn't allowed inside <code> (<pre> is flow content, <code>'s 
content model only accepts phrasing content).

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