# Discourse doesn't follow the CommonMark spec for HTML \<pre\> tags inside code spans

**URL:** <https://meta.discourse.org/t/discourse-doesnt-follow-the-commonmark-spec-for-html-pre-tags-inside-code-spans/25406>\
**Category:** Bug\
**Tags:** markdown-it-review\
**Created:** [2015 年2 月 19 日 15:46 UTC](https://meta.discourse.org/t/discourse-doesnt-follow-the-commonmark-spec-for-html-pre-tags-inside-code-spans/25406 "2015-02-19T15:46:13Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

作者： ![Ajedi32](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ajedi32/32/107370_2.png) [@Ajedi32](https://meta.discourse.org/u/Ajedi32)\
发布日期： [2015 年2 月 19 日 15:46 UTC](https://meta.discourse.org/t/discourse-doesnt-follow-the-commonmark-spec-for-html-pre-tags-inside-code-spans/25406/1 "2015-02-19T15:46:13Z")

</div>

The CommonMark spec [states](http://spec.commonmark.org/0.17/#example-257):

> Code spans, HTML tags, and autolinks have the same precedence. Thus, this is code:
> 
> Input:
> 
> ```plaintext
> `<a href="`">`
> 
> ```
> 
> Render:
> 
> ```plaintext
> <p><code>&lt;a href=&quot;</code>&quot;&gt;`</p>
> 
> ```

The problem is that this doesn’t work for `<pre>` tags when any part of the input markdown following the code span contains preformatted text. (Example shown in my reply to this post.)

---

_[View the full topic](https://meta.discourse.org/t/discourse-doesnt-follow-the-commonmark-spec-for-html-pre-tags-inside-code-spans/25406)._
