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": "354a7cb89e8f39c2a291f2b550ee04f694bd39f7b0404dff2475836eaee12966",
"pubkey": "fddf487eea9db57a6e320f80e5cb63de50bedf539695a41c0d447be6c23643e1",
"created_at": 1723792583,
"kind": 1,
"tags": [
[
"t",
"html"
],
[
"proxy",
"https://mastodon.social/users/Edent/statuses/112970470761757145",
"activitypub"
]
],
"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": "941cf6f8dc62f7189d200b24c59c0146fcfd0a951355fe83b8b68f6b1d6ec4993be8fbbef656a8ecfc9ddedc20e90eebe21e3b733c543b805eb628d99d1080fc"
}