W3C home > Mailing lists > Public > public-html-comments@w3.org > April 2012

Re: Adding language metadata on code elements

From: Ian Hickson <ian@hixie.ch>
Date: Tue, 3 Apr 2012 04:44:35 +0000 (UTC)
To: Kevin Sweeney <ksweeney@vimeo.com>
cc: "public-html-comments@w3.org" <public-html-comments@w3.org>
Message-ID: <Pine.LNX.4.64.1204030444160.22654@ps20323.dreamhostps.com>
On Mon, 2 Apr 2012, Kevin Sweeney wrote:
> The current draft states:
> “Although there is no formal way to indicate the language of computer 
> code being marked up, authors who wish to mark code 
> (http://www.w3.org/TR/2011/WD-html5-20110525/text-level-semantics.html#the-code-element) 
> 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 "language-" to the element.”
> I was wondering why this is the preferred way over a data attribute such 
> as "data-langauge"? Is this bug-worthy or is there already a discussion 
> in the archive that I overlooked?

data-language="" would be site-specific. The idea of using language-* is 
that it can be a convention shared amongst many sites.

Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Tuesday, 3 April 2012 04:45:06 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:26:28 UTC