# When the info string already starts with \`language-\`, do not add the \`language-\` prefix

**URL:** <https://talk.commonmark.org/t/when-the-info-string-already-starts-with-language-do-not-add-the-language-prefix/9054>\
**Category:** Spec\
**Created:** [April 25, 2026, 3:14pm UTC](https://talk.commonmark.org/t/when-the-info-string-already-starts-with-language-do-not-add-the-language-prefix/9054 "2026-04-25T15:14:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![znewt99](https://cdn.commonmark.org/letter_avatar_proxy/v2/letter/z/74df32/32.png) [@znewt99](https://talk.commonmark.org/u/znewt99)\
**Post date:** [April 25, 2026, 3:14pm UTC](https://talk.commonmark.org/t/when-the-info-string-already-starts-with-language-do-not-add-the-language-prefix/9054/1 "2026-04-25T15:14:59Z")

</div>

Should a change be made to the spec, so the behavior of cmark & commonmark.js matches the spec?

For context, see [commonmark.js issue #277](https://github.com/commonmark/commonmark.js/issues/277)

[Here’s what the spec currently says:](https://spec.commonmark.org/0.31.2/#fenced-code-blocks)

> Although this spec doesn’t mandate any particular treatment of the info string, the first word is typically used to specify the language of the code block. In HTML output, the language is normally indicated by adding a class to the code element consisting of language- followed by the language name.

---

<div class="post-metadata">

**Author:** ![Crissov](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/crissov/32/1455_2.png) [@Crissov](https://talk.commonmark.org/u/Crissov)\
**Post date:** [May 23, 2026, 3:41pm UTC](https://talk.commonmark.org/t/when-the-info-string-already-starts-with-language-do-not-add-the-language-prefix/9054/2 "2026-05-23T15:41:35Z")

</div>

Are you proposing to change that last sentence

> [@znewt99](#):
>
> > In HTML output, the language is normally indicated by adding a class to the `code` element consisting of `language-` followed by the language name.

to something like

> In HTML output, the language is normally indicated by adding a class to the `code` element consisting of `language-` followed by the language name, unless this already starts with `language-`.

or to drop it completely?

---

<div class="post-metadata">

**Author:** ![znewt99](https://cdn.commonmark.org/letter_avatar_proxy/v2/letter/z/74df32/32.png) [@znewt99](https://talk.commonmark.org/u/znewt99)\
**Post date:** [May 23, 2026, 6:38pm UTC](https://talk.commonmark.org/t/when-the-info-string-already-starts-with-language-do-not-add-the-language-prefix/9054/4 "2026-05-23T18:38:26Z")

</div>

> [@Crissov](#):
>
> In HTML output, the language is normally indicated by adding a class to the `code` element consisting of `language-` followed by the language name, unless this already starts with `language-`.

Something exactly like this
