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

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.

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.

Shaun



On 2011-09-09 8:09 AM, Ian Hickson wrote:
> On Fri, 6 May 2011, Simon Pieters wrote:
>>> Modified: source
>>> ===================================================================
>>> --- source	2011-05-05 22:03:52 UTC (rev 6087)
>>> +++ source	2011-05-05 22:45:13 UTC (rev 6088)
>>> @@ -105238,7 +105238,6 @@
>>>     <dd><p>Use an explicit<code>form</code>  and<span
>>> title="attr-input-type-text">text field</span>  combination instead.</p></dd>
>>>    <dt><dfn><code>listing</code></dfn></dt>
>>> -<dt><dfn><code>xmp</code></dfn></dt>
>>>     <dd><p>Use<code>pre</code>  and<code>code</code>  instead.</p></dd>
>>>    <dt><dfn><code>nextid</code></dfn></dt>
>>> @@ -105256,6 +105255,9 @@
>>>     <dt><dfn><code>strike</code></dfn></dt>
>>>     <dd><p>Use<code>del</code>  instead if the element is marking an edit,
>>> otherwise use<code>s</code>  instead.</p></dd>
>>> +<dt><dfn><code>xmp</code></dfn></dt>
>>> +<dd><p>Use<code>code</code>  instead, and escape "<code
>>> title="">&lt;</code>" and"<code title="">&amp;</code>" characters as"<code
>>> title="">&amp;lt;</code>" and"<code title="">&amp;amp;</code>"
>>> respectively.</p></dd>
>> For xmp it should say "Use pre and code ..." since just code is not a drop-in
>> replacement for xmp.
> Good point.
>
> I went with "pre or code". I don't think you'd use both, typically, right?
>

Received on Friday, 9 September 2011 15:42:33 UTC