HTML5 Tracker

Diff (omit for latest revision)
Filter

Short URL: http://html5.org/r/1144

SVNBugCommentTime (UTC)
1144Add a hint for what to do if you want to give the language of a <code> element's contents.2007-12-11 04:29
Index: source
===================================================================
--- source	(revision 1143)
+++ source	(revision 1144)
@@ -9417,20 +9417,30 @@
   code. This could be an XML element name, a filename, a computer
   program, or any other string that a computer would recognise.</p>
 
-  <p class="note">See the <code>pre</code> element for more detais.</p>
+  <p>Although there is no formal way to indicate the language of
+  computer code being marked up, authors who wish to mark
+  <code>code</code> elements with the language used, e.g. so that
+  syntax highlighting scripts can use the right rules, may do so by
+  adding a class prefixed with "<code title="">language-</code>" to
+  the element.</p>
 
   <div class="example">
 
    <p>The following example shows how a block of code could be marked
    up using the <code>pre</code> and <code>code</code> elements.</p>
 
-   <pre>&lt;pre>&lt;code>var i: Integer;
+   <pre>&lt;pre>&lt;code class="language-pascal">var i: Integer;
 begin
    i := 1;
 end.&lt;/code>&lt;/pre></pre>
 
+   <p>A class is used in that example to indicate the language
+   used.</p>
+
   </div>
 
+  <p class="note">See the <code>pre</code> element for more detais.</p>
+
   <h4>The <dfn><code>var</code></dfn> element</h4>
 
   <p><span>Strictly inline-level content</span>.</p>
@@ -40829,36 +40839,36 @@
   Derek Featherstone, DeWitt Clinton, Dimitri Glazkov, dolphinling,
   Doron Rosenberg, Doug Kramer, Eira Monstad, Elliotte Harold, Erik
   Arvidsson, Evan Martin, fantasai, Franck 'Shift' Qu&eacute;lain,
-  Geoffrey Sneddon, H&aring;kon Wium Lie, Henri Sivonen, Henrik Lied,
-  Ignacio Javier, Ivo Emanuel Gon&ccedil;alves, J. King, James Graham,
-  James M Snell, James Perrett, Jan-Klaas Kollhof, Jasper
-  Bryant-Greene, Jeff Cutsinger, Jeff Walden, Jens Bannmann, Jeroen
-  van der Meer, Joel Spolsky, John Boyer, John Bussjaeger, John
-  Harding, Johnny Stenback, Jon Perlow, Jonathan Worent, Jorgen
-  Horstink, Josh Levenberg, Joshua Randall, Jukka K. Korpela, Kai
-  Hendry, <!-- Keryx Web, = Lars Gunther --> Kornel Lesinski,
-  &#x9ed2;&#x6fa4;&#x525b;&#x5fd7; (KUROSAWA Takeshi), Kristof
-  Zelechovski, Lachlan Hunt, Larry Page, Lars Gunther, Laurens Holst,
-  Lenny Domnitser, L&eacute;onard Bouchet, Leons Petrazickis,
+  Garrett Smith, Geoffrey Sneddon, H&aring;kon Wium Lie, Henri
+  Sivonen, Henrik Lied, Ignacio Javier, Ivo Emanuel Gon&ccedil;alves,
+  J. King, James Graham, James M Snell, James Perrett, Jan-Klaas
+  Kollhof, Jasper Bryant-Greene, Jeff Cutsinger, Jeff Walden, Jens
+  Bannmann, Jeroen van der Meer, Joel Spolsky, John Boyer, John
+  Bussjaeger, John Harding, Johnny Stenback, Jon Perlow, Jonathan
+  Worent, Jorgen Horstink, Josh Levenberg, Joshua Randall, Jukka
+  K. Korpela, Kai Hendry, <!-- Keryx Web, = Lars Gunther --> Kornel
+  Lesinski, &#x9ed2;&#x6fa4;&#x525b;&#x5fd7; (KUROSAWA Takeshi),
+  Kristof Zelechovski, Lachlan Hunt, Larry Page, Lars Gunther, Laurens
+  Holst, Lenny Domnitser, L&eacute;onard Bouchet, Leons Petrazickis,
   Logan<!-- on moz irc -->, Loune, Maciej Stachowiak, Malcolm Rowe,
   Mark Nottingham, Mark Rowe<!--bdash-->, Mark Schenk, Martijn
   Wargers, Martin Atkins, Martin D&uuml;rst, Martin Honnen, Mathieu
   Henri, Matthew Mastracci, Matthew Raymond, Matthew Thomas, Mattias
   Waldau, Max Romantschuk, Michael 'Ratt' Iannarelli, Michael
   A. Nachbaur, Michael A. Puls II<!--Shadow2531-->, Michael Gratton,
-  Michael Powers, Michel Fortin, Mihai &#x015E;ucan<!-- from ROBO
-  Design -->, Mike Brown, Mike Dierken<!-- S. Mike Dierken -->, Mike
-  Dixon, Mike Schinkel, Mike Shaver, Mikko Rantalainen, Neil Deakin,
-  Olav Junker Kj&aelig;r, Peter Kasting, Philip Taylor, Rajas Moonka,
-  Ralph Giles, Rimantas Liubertas, Robert O'Callahan, Robert Sayre,
-  Roman Ivanov, S. Mike Dierken, Sam Ruby, Sam Weinig, Scott Hess,
-  Sean Knapp, Shaun Inman, Silvia Pfeiffer, Simon Pieters, Stefan
-  Haustein, Stephen Ma, Steve Runyon, Steven Garrity, Stewart Brodie,
-  Stuart Parmenter, Tantek &Ccedil;elik, Thomas Broyer, Thomas
-  O'Connor, Tim Altman, Tyler Close, Vladimir Vuki&#x0107;evi&#x0107;,
-  Wakaba, William Swanson, &Oslash;istein E. Andersen, and everyone on
-  the WHATWG mailing list for their useful and substantial
-  comments.</p>
+  Michael Powers, Michel Fortin, Michiel van der Blonk, Mihai
+  &#x015E;ucan<!-- from ROBO Design -->, Mike Brown, Mike Dierken<!--
+  S. Mike Dierken -->, Mike Dixon, Mike Schinkel, Mike Shaver, Mikko
+  Rantalainen, Neil Deakin, Olav Junker Kj&aelig;r, Peter Kasting,
+  Philip Taylor, Rajas Moonka, Ralph Giles, Rimantas Liubertas, Robert
+  O'Callahan, Robert Sayre, Roman Ivanov, S. Mike Dierken, Sam Ruby,
+  Sam Weinig, Scott Hess, Sean Knapp, Shaun Inman, Silvia Pfeiffer,
+  Simon Pieters, Stefan Haustein, Stephen Ma, Steve Runyon, Steven
+  Garrity, Stewart Brodie, Stuart Parmenter, Tantek &Ccedil;elik,
+  Thomas Broyer, Thomas O'Connor, Tim Altman, Tyler Close, Vladimir
+  Vuki&#x0107;evi&#x0107;, Wakaba, William Swanson, &Oslash;istein
+  E. Andersen, and everyone on the WHATWG mailing list for their
+  useful and substantial comments.</p>
 
   <p>Special thanks to Richard Williamson for creating the first
   implementation of <code>canvas</code> in Safari, from which the

|