# Fenced code blocks should add class to \`code\` rather than \`pre\`, matching the HTML best practice

**URL:** <https://talk.commonmark.org/t/fenced-code-blocks-should-add-class-to-code-rather-than-pre-matching-the-html-best-practice/136>\
**Category:** Spec\
**Created:** [September 3, 2014, 11:09pm UTC](https://talk.commonmark.org/t/fenced-code-blocks-should-add-class-to-code-rather-than-pre-matching-the-html-best-practice/136 "2014-09-03T23:09:22Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![rwzy](https://cdn.commonmark.org/letter_avatar_proxy/v2/letter/r/3d9bf3/32.png) [@rwzy](https://talk.commonmark.org/u/rwzy)\
**Post date:** [September 5, 2014, 3:08pm UTC](https://talk.commonmark.org/t/fenced-code-blocks-should-add-class-to-code-rather-than-pre-matching-the-html-best-practice/136/4 "2014-09-05T15:08:41Z")

</div>

I agree but I’d just like to point out what _potentially_ may be considered an edge case. If [#272](http://talk.commonmark.org/t/consistent-attribute-syntax/272) gets included, then a ‘code’ block without any language declaration should probably not have a code tag (which pandoc markdown actually includes) and only a pre tag, because it’s assumed it’s not actually computer code, but just preformatted text in general.

So this would mean that:

````
``` {.class}
verbatim text
```

````

should output:

```auto
<pre class="class">verbatim text</pre>

```

instead of:

```auto
<pre><code class="class">verbatim text</code></pre>

```

But without the curly braces, it should of course be as normal (mathias’ proposal).

Is this the correct method of interpretation? Have I excluded another particular case where no language declaration might still be computer code/require a `code` tag?

---

_[View the full topic](https://talk.commonmark.org/t/fenced-code-blocks-should-add-class-to-code-rather-than-pre-matching-the-html-best-practice/136)._
