Re: code and blockcode

Jukka K. Korpela wrote:
> _If_ such an attribute were added, the most obvious candidate for its 
> name would be "type", since that name is already used in some elements 
> where a data format is specified by its Internet media type, and 
> technically the value here, too, would probably have to be specified 
> that way, e.g.
> <code type="text/html">&lt;font&gt;</code> tags considered harmful.x

That's certainly a possibility to consider, however my one concern with 
using the type attribute is that in this case, the element's content is 
not really the same as that indicated by the media type, but rather a 
marked up representation of it.  Compare these:

<code type="application/javascript">
var <var>foo</var> = document.getElementById("foo");
// Do something with foo...

<script type="application/javascript">
var foo = document.getElementById("foo");
// Do something with foo...

In the first case the content isn't really an executable block of 
javascript, whereas in the second case it is; yet the same attribute has 
been used for both purposes.

Lachlan Hunt

Received on Wednesday, 13 July 2005 08:59:04 UTC