# Discourse and CommonMark

**URL:** https://meta.discourse.org/t/discourse-and-commonmark/25410
**Category:** Feature
**Created:** [February 19, 2015, 4:15pm UTC](https://meta.discourse.org/t/discourse-and-commonmark/25410 "2015-02-19T16:15:24Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![ky\_metro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ky_metro/32/42807_2.png) [@ky\_metro](https://meta.discourse.org/u/ky_metro)
#### Post date: [February 19, 2015, 4:15pm UTC](https://meta.discourse.org/t/discourse-and-commonmark/25410/1 "2015-02-19T16:15:24Z")

</div>

Continuing the discussion from [Discourse doesn’t follow the CommonMark spec for HTML](https://meta.discourse.org/t/discourse-doesnt-follow-the-commonmark-spec-for-html-pre-tags-inside-code-spans/25406/4)

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

> [@Discourse doesn't follow the CommonMark spec for HTML \<pre\> tags inside code spans](https://meta.discourse.org/t/discourse-doesnt-follow-the-commonmark-spec-for-html-pre-tags-inside-code-spans/25406/4):
>
> Discourse isn’t on CommonMark yet.

I’ve wondered about this for awhile now. They aren’t that far off, but there are differences I know that will break some of my posts.

What happens to older posts if/when the Markdown interpreter changes; will we get a choice of interpreters to use, or just have to fix whatever breaks by hand? ie write it to the tighter spec now and avoid future issues?

Also, where is this on the roadmap?
```

---

<div class="post-metadata">

### Author: ![elberet](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elberet/32/122404_2.png) [@elberet](https://meta.discourse.org/u/elberet)
#### Post date: [February 19, 2015, 5:53pm UTC](https://meta.discourse.org/t/discourse-and-commonmark/25410/2 "2015-02-19T17:53:38Z")

</div>

> [@ky\_metro](#):
>
> What happens to older posts if/when the Markdown interpreter changes

At first, nothing at all. Discourse runs the raw post content through its Markdown parser only when the post is saved, not when it is read.

This “cooked” post text remains untouched unless the post is edited, an admin (or mod?) clicks a special button (which affects that post only) or the server admin runs `rake posts:rebake` (which would rebake _all_ posts in the forum).

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [February 20, 2015, 6:36am UTC](https://meta.discourse.org/t/discourse-and-commonmark/25410/3 "2015-02-20T06:36:45Z")

</div>

Actually, the `BAKED_VERSION` variable would be incremented if a major change happened, which triggers a background task to, every hour? or so, rebake 100 posts that are currently on the old version.

---

<div class="post-metadata">

### Author: ![elberet](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elberet/32/122404_2.png) [@elberet](https://meta.discourse.org/u/elberet)
#### Post date: [February 20, 2015, 9:52am UTC](https://meta.discourse.org/t/discourse-and-commonmark/25410/4 "2015-02-20T09:52:40Z")

</div>

Oh, was this a recent addition? I thought I had read all the codepaths involved with (re)baking posts.

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [February 20, 2015, 10:00am UTC](https://meta.discourse.org/t/discourse-and-commonmark/25410/5 "2015-02-20T10:00:26Z")

</div>

May 28 2014

[https://github.com/discourse/discourse/commit/f6753d3d4642da5166d7466d53d707b89b6ed90b](https://github.com/discourse/discourse/commit/f6753d3d4642da5166d7466d53d707b89b6ed90b)

The current version reads:

```
    Post.where('baked_version IS NULL OR baked_version < ?', BAKED_VERSION)

```

---

<div class="post-metadata">

### Author: ![elberet](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elberet/32/122404_2.png) [@elberet](https://meta.discourse.org/u/elberet)
#### Post date: [February 20, 2015, 10:17am UTC](https://meta.discourse.org/t/discourse-and-commonmark/25410/6 "2015-02-20T10:17:16Z")

</div>

I see. Guess I should schedule an appointment with my eye doctor, seems I’m due for another diopter or two. 😐

Anyways, this seems crufty since the idea of version-dependent rebaking clashes a bit with the existance of different `cook_method`s.

---

<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 20, 2015, 11:55pm UTC](https://meta.discourse.org/t/discourse-and-commonmark/25410/7 "2015-02-20T23:55:54Z")

</div>

Any comment on this @sam?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [February 21, 2015, 1:34am UTC](https://meta.discourse.org/t/discourse-and-commonmark/25410/8 "2015-02-21T01:34:35Z")

</div>

If we need to support more baking methods we are going to have to add a column on the posts table, I still thing version is correct there.

---

<div class="post-metadata">

### Author: ![Jake\_Shadle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jake_shadle/32/88328_2.png) [@Jake\_Shadle](https://meta.discourse.org/u/Jake_Shadle)
#### Post date: [March 8, 2016, 12:01pm UTC](https://meta.discourse.org/t/discourse-and-commonmark/25410/9 "2016-03-08T12:01:38Z")

</div>

Is there any idea of when CommonMark support will be added?

I only bring this up because our users are still incapable of writing proper lists, which CommonMark seems to handle gracefully without a hard requirement on a line break between a paragraph and a list for it to be rendered as the user intends it to be.

Obviously this is a small issue in the grand scheme of things, but I imagine our forum is not the only one where this is the #1 most common mistake made when writing posts.

---

<div class="post-metadata">

### Author: ![erlend\_sh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/erlend_sh/32/119475_2.png) [@erlend\_sh](https://meta.discourse.org/u/erlend_sh)
#### Post date: [March 8, 2016, 12:11pm UTC](https://meta.discourse.org/t/discourse-and-commonmark/25410/10 "2016-03-08T12:11:11Z")

</div>

I believe it’s scheduled for v1.6:

> [@Discourse Version 1.6](https://meta.discourse.org/t/discourse-version-1-6/36402/1):
>
> Refactor Markdown into a dedicated, defer loaded, js include

---

<div class="post-metadata">

### Author: ![Jake\_Shadle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jake_shadle/32/88328_2.png) [@Jake\_Shadle](https://meta.discourse.org/u/Jake_Shadle)
#### Post date: [March 8, 2016, 12:16pm UTC](https://meta.discourse.org/t/discourse-and-commonmark/25410/11 "2016-03-08T12:16:49Z")

</div>

Ahh ok, thanks for the link, that didn’t show up in my search. 😉

However, it also says

> [@Discourse Version 1.6](https://meta.discourse.org/t/discourse-version-1-6/36402/1):
>
> Convert all markdown stuff to ES6 (prep work for markdown engine move)

which sounds like maybe it is actually after 1.6?

---

<div class="post-metadata">

### Author: ![erlend\_sh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/erlend_sh/32/119475_2.png) [@erlend\_sh](https://meta.discourse.org/u/erlend_sh)
#### Post date: [March 8, 2016, 12:22pm UTC](https://meta.discourse.org/t/discourse-and-commonmark/25410/12 "2016-03-08T12:22:18Z")

</div>

It’s prep work for the task that I linked to above, which is part of the same release 😉

---

<div class="post-metadata">

### Author: ![Jake\_Shadle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jake_shadle/32/88328_2.png) [@Jake\_Shadle](https://meta.discourse.org/u/Jake_Shadle)
#### Post date: [March 8, 2016, 12:24pm UTC](https://meta.discourse.org/t/discourse-and-commonmark/25410/13 "2016-03-08T12:24:12Z")

</div>

Ok, confusing, but I get it now, thanks! 🙂

As you might be able to tell, I am **really** tired of this particular mistake so will be very happy when I can stop editing everyone’s posts to correct it. 😃

---

<div class="post-metadata">

### Author: ![wil93](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/wil93/32/121264_2.png) [@wil93](https://meta.discourse.org/u/wil93)
#### Post date: [August 17, 2016, 4:58pm UTC](https://meta.discourse.org/t/discourse-and-commonmark/25410/14 "2016-08-17T16:58:22Z")

</div>

I’m on discourse v1.7.0.beta2 +49 and I still see weird Markdown behavior. Has discourse switched to CommonMark yet?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [August 17, 2016, 5:50pm UTC](https://meta.discourse.org/t/discourse-and-commonmark/25410/15 "2016-08-17T17:50:57Z")

</div>

Not yet. A lot of ground work for that was done on 1.6, tough.

---

<div class="post-metadata">

### Author: ![mcwumbly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcwumbly/32/103861_2.png) [@mcwumbly](https://meta.discourse.org/u/mcwumbly)
#### Post date: [February 9, 2017, 3:08pm UTC](https://meta.discourse.org/t/discourse-and-commonmark/25410/16 "2017-02-09T15:08:09Z")

</div>

> [@sam](#):
>
> we got to wait on the markdown it move

Curious if there is any notion of when this might happen at this point…

I see that this is not on the [1.8 Release](https://meta.discourse.org/t/discourse-version-1-8/49801) plan.

And that the the to-do list for [CommonMark v1.0](https://talk.commonmark.org/t/issues-we-must-resolve-before-1-0-release-8-remaining/1287) is not draining too quickly.

Is CommonMark 1.0 considered a prerequisite for the transition? Or is it more about the stability of [markdown-it](https://github.com/markdown-it/markdown-it) API?

This is not a “where the !&\*# is my CommonMark?” question. I’m just curious to understand what the current thinking is…

---

<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 9, 2017, 7:20pm UTC](https://meta.discourse.org/t/discourse-and-commonmark/25410/17 "2017-02-09T19:20:26Z")

</div>

It is taking longer than expected, is all. I would be shocked if we do not get to this by sometime in 2018 thoigh.

---

<div class="post-metadata">

### Author: ![burke](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/burke/32/4211_2.png) [@burke](https://meta.discourse.org/u/burke)
#### Post date: [February 9, 2017, 9:51pm UTC](https://meta.discourse.org/t/discourse-and-commonmark/25410/18 "2017-02-09T21:51:05Z")

</div>

> [@codinghorror](#):
>
> It is taking longer than expected, is all. I would be shocked if we do not get to this by sometime in 2018 though.

Too big of a project for GSoC 2017?

---

<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 9, 2017, 9:51pm UTC](https://meta.discourse.org/t/discourse-and-commonmark/25410/19 "2017-02-09T21:51:25Z")

</div>

Vastly too big and complex.

---

<div class="post-metadata">

### Author: ![chapoi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapoi/32/537252_2.png) [@chapoi](https://meta.discourse.org/u/chapoi)
#### Post date: [December 4, 2025, 11:33am UTC](https://meta.discourse.org/t/discourse-and-commonmark/25410/20 "2025-12-04T11:33:35Z")

</div>


