W3C home > Mailing lists > Public > public-html-comments@w3.org > March 2015

Re: <code> element and scripting languages

From: Andrea Rendine <master.skywalker.88@gmail.com>
Date: Wed, 18 Mar 2015 01:45:44 +0100
Message-ID: <CAGxST9=s2a0JCxGQU+q=snyo-2OK9RFrZVJpwjXaiOsWi-TADA@mail.gmail.com>
To: Gannon Dick <gannon_dick@yahoo.com>, "public-html-comments@w3.org" <public-html-comments@w3.org>
I know this discussion will bring me nowhere, so this message is just a
Yes, what I want is an indication, not the exact MIME type associated to
the scripting language. Which would be useless, since even if I have <code
language="application/xml"> for example, it's just plain text to be
identified for search engines and maybe for syntax highlighting, UA speech
syntesizers, translation tools. Code is neither to be executed nor
evaluated. It's just to be set apart from any other text, because it's
basically not normal text in a normal language. And while I have read more
about Best Current Practices and I understand it's all about using language
codes *specifically* on the Internet, it's just what is needed for this
particular purpose (and it is the specific standard referred to by the spec
- and last but not least, it's now something like 6 year old. Is its
implementation still so controversial?).

If you have read other answers to the thread, you saw that some authors use
data-* attributes and this is unacceptable. Using class as suggested by the
spec, however, is terrible as well because every standard is missing and
class has no syntax value (as well as interfering with CSS selector).
@lang, on the other hand, is not only semantically "valuable" (we are still
talking about a form of identifying textual expression means), but also
technically correct - consider that CSS3 has a specific selector for lang
property (not only value, as it applies to an element with a @lang, as well
as its descendants without a different @lang).
These are my final points:
 1. (esp. for mr Gannon Dick) is there any room left for an extension
subtag, as defined by BCP-47 at section 2.2.6? I.e. is such a definition of
any value, and could "programming" language be registered according to that
 2. if the answer is negative, and/or if BCP-47 is such an unreliable
standard, what are we left with? Could <code> benefit from the @language
attribute as it was (uncanonically and uselessly) defined on <script>
elements? <code language="whatever"> would leave all the issues about
translation and speech recognition unsolved, but it would be a good point
for programming language detection. Why hasn't it ever been proposed?

Thanks to anybody willing to contribute.
Received on Wednesday, 18 March 2015 00:46:11 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 18 March 2015 00:46:11 UTC