Short URL: http://html5.org/r/1144
| SVN | Bug | Comment | Time (UTC) |
|---|---|---|---|
| 1144 | Add 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><pre><code>var i: Integer;
+ <pre><pre><code class="language-pascal">var i: Integer;
begin
i := 1;
end.</code></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élain,
- Geoffrey Sneddon, Håkon Wium Lie, Henri Sivonen, Henrik Lied,
- Ignacio Javier, Ivo Emanuel Gonç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,
- 黒澤剛志 (KUROSAWA Takeshi), Kristof
- Zelechovski, Lachlan Hunt, Larry Page, Lars Gunther, Laurens Holst,
- Lenny Domnitser, Léonard Bouchet, Leons Petrazickis,
+ Garrett Smith, Geoffrey Sneddon, Håkon Wium Lie, Henri
+ Sivonen, Henrik Lied, Ignacio Javier, Ivo Emanuel Gonç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, 黒澤剛志 (KUROSAWA Takeshi),
+ Kristof Zelechovski, Lachlan Hunt, Larry Page, Lars Gunther, Laurens
+ Holst, Lenny Domnitser, Lé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ü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 Şucan<!-- from ROBO
- Design -->, Mike Brown, Mike Dierken<!-- S. Mike Dierken -->, Mike
- Dixon, Mike Schinkel, Mike Shaver, Mikko Rantalainen, Neil Deakin,
- Olav Junker Kjæ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 Çelik, Thomas Broyer, Thomas
- O'Connor, Tim Altman, Tyler Close, Vladimir Vukićević,
- Wakaba, William Swanson, Ø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
+ Şucan<!-- from ROBO Design -->, Mike Brown, Mike Dierken<!--
+ S. Mike Dierken -->, Mike Dixon, Mike Schinkel, Mike Shaver, Mikko
+ Rantalainen, Neil Deakin, Olav Junker Kjæ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 Çelik,
+ Thomas Broyer, Thomas O'Connor, Tim Altman, Tyler Close, Vladimir
+ Vukićević, Wakaba, William Swanson, Ø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