Terence Eden on Nostr: An #HTML question for you fine folk. Should the `lang` attribute be used to indicate ...
An #HTML question for you fine folk.
Should the `lang` attribute be used to indicate computer programming languages?
For example
`<code lang="python">…</code>`
I know that the spec says it should be a valid BCP 47 language tag. But I wonder if that limitation is still useful.
What other semantic ways are there of indicating the programming language of a code snippet?
Published at
2024-08-16 07:16:23Event JSON
{
"id": "70e698209eb88f89a4d7f648ff4993621dfd7ea2c70a4bbd5a351fe45d3dea6b",
"pubkey": "350b4da116bd4aa32feaa4d36a4aa69b544e430946c2a9fa1ac43b3342652b3e",
"created_at": 1723792583,
"kind": 1,
"tags": [
[
"t",
"html"
],
[
"proxy",
"https://mastodon.social/@Edent/112970470761757145",
"web"
],
[
"proxy",
"https://mastodon.social/users/Edent/statuses/112970470761757145",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://mastodon.social/users/Edent/statuses/112970470761757145",
"pink.momostr"
],
[
"-"
]
],
"content": "An #HTML question for you fine folk.\n\nShould the `lang` attribute be used to indicate computer programming languages?\n\nFor example\n`\u003ccode lang=\"python\"\u003e…\u003c/code\u003e`\n\nI know that the spec says it should be a valid BCP 47 language tag. But I wonder if that limitation is still useful.\n\nWhat other semantic ways are there of indicating the programming language of a code snippet?",
"sig": "d6851247ff69ad6538604355b67f8488316d0afffe9aa6359390148eebc612278ac07acc7e861a657b0d1747e9a16f5b035ea8a31bf095bfda06f6fbec222e52"
}