# Specifying language of fenced code blocks using info string

**URL:** https://meta.discourse.org/t/specifying-language-of-fenced-code-blocks-using-info-string/39760
**Category:** UX
**Created:** [February 17, 2016, 11:09pm UTC](https://meta.discourse.org/t/specifying-language-of-fenced-code-blocks-using-info-string/39760 "2016-02-17T23:09:14Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![FichteFoll](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fichtefoll/32/105406_2.png) [@FichteFoll](https://meta.discourse.org/u/FichteFoll)
#### Post date: [February 17, 2016, 11:09pm UTC](https://meta.discourse.org/t/specifying-language-of-fenced-code-blocks-using-info-string/39760/1 "2016-02-17T23:09:14Z")

</div>

From Github I am used to specifying the language of the code block in the “info string” (name from [commonmark spec](http://spec.commonmark.org/0.24/#info-string)), but it seems that Discourse does not do this. At least not this and the other Discoruse instance I am using.

When I inspect the resulting `<pre><code>` block it always has `lang-auto` set.

### Examples

The following is YAML and has ` ```yaml` specified, but is highlighted as CSS:

```yaml
- include: scope:source.c#cparens

```

The following is (again) YAML and has ` ```yaml` specified, but is highlighted as PHP:

```yaml
- include: scope:source.c#parens

```

* * *

[This post in raw format](https://meta.discourse.org/raw/39760).

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [February 18, 2016, 12:39am UTC](https://meta.discourse.org/t/specifying-language-of-fenced-code-blocks-using-info-string/39760/2 "2016-02-18T00:39:06Z")

</div>

Depends what languages are allowed, we don’t carry the hundreds of kilobytes necessary to highlight every possible language. Check your site settings.

---

<div class="post-metadata">

### Author: ![FichteFoll](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fichtefoll/32/105406_2.png) [@FichteFoll](https://meta.discourse.org/u/FichteFoll)
#### Post date: [February 18, 2016, 12:42am UTC](https://meta.discourse.org/t/specifying-language-of-fenced-code-blocks-using-info-string/39760/3 "2016-02-18T00:42:22Z")

</div>

Could you perhaps improve UX in the sense that trying to highlight code as a non-supported (or non-enabled) language gets seen by the user?
