# CommonMark testing started here!

**URL:** https://meta.discourse.org/t/commonmark-testing-started-here/65121
**Category:** Feature
**Created:** [June 26, 2017, 12:44pm UTC](https://meta.discourse.org/t/commonmark-testing-started-here/65121 "2017-06-26T12:44:40Z")
**Posts on this page:** 20
**Page:** 1

<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: [June 26, 2017, 12:44pm UTC](https://meta.discourse.org/t/commonmark-testing-started-here/65121/1 "2017-06-26T12:44:41Z")

</div>

Per our [migration plans](https://meta.discourse.org/t/discourse-commonmark-migration-plans-confetti-ball-balloon), I just enabled [markdown.it](https://github.com/markdown-it/markdown-it) at Meta.

It is an excellent [CommonMark](http://commonmark.org/) compliant engine. I expect quite a few edges to be found during this period of testing.

**Do not open bugs about the new Engine** , just reply here.

I/we will be updating the top post here with the list of issues and striking out stuff as it is fixed.

### Current known issues (to be fixed)

- ✅ Onebox vanishes after you start typing and works not-super consistently

- ✅ pending approval does not render

- ✅ Quote without preceding empty line does not work.

- ✅ Onebox of reply is missing tons of info and not rendering right

- ✅ When quoting the composer sometimes inserts a `quote` block in the middle of a line (not a new bug but broken with new engine)

- ✅ Onebox bypass is not working

- ✅ Table is not showing up styled in preview

- ✅ Details composer toolbar generating inline details

- ✅ Emoji → Image conversion (when posing Emoji’s via a phone) is not implemented yet.

- ✅ 2 polls in a post seems to be … not that good.

- ✅ Sanitizer stripping out right align style for tables

- ✅ Some BBCode is unimplemented: `[email]`, `[url]`, `[code]` and `[img]`

- ✅[somelink - Just another link on the internet | somelink](http://somelink.com/#test) ◀ fails cause of the tag/category plugin

- ✅ Mention after paragraph is strange

- Can add any oneboxes after an IMG tag

- :email, class\_name: is not an emoji

- [https://medium.com/@nicksantos](https://medium.com/@nicksantos) not autolinked

### New features

- All of this: [CommonMark Spec](http://spec.commonmark.org/0.27)

- Support for GFM tables per: [Organizing information with tables - GitHub Docs](https://help.github.com/articles/organizing-information-with-tables/) (enabled by default)

- Support for a basic “typographer” see: [https://markdown-it.github.io/](https://markdown-it.github.io/) to enable set `enable_markdown_typographer` to true

### Issues that will not be fixed

- Mixing inline and multiline BBCode will [no longer be supported](https://meta.discourse.org/t/discourse-commonmark-migration-plans-confetti-ball-balloon/64234/6).

- Core will not implement `[ul]` `[ol]` and `[li]` support for BBCode cause it is a recipe for failure.

This topic is wiki, if you are TL3 or above feel free to clean it up.

---

<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: [June 26, 2017, 12:45pm UTC](https://meta.discourse.org/t/commonmark-testing-started-here/65121/2 "2017-06-26T12:45:10Z")

</div>



---

<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: [June 26, 2017, 8:36pm UTC](https://meta.discourse.org/t/commonmark-testing-started-here/65121/6 "2017-06-26T20:36:30Z")

</div>

> [@Tom\_Newsom](#):
>
> When you have a spare 5 seconds please add table support 😛

Wikipedia Table (converted to markdown)

| Name | Programming language | License |
| --- | --- | --- |
| bbPress | PHP[2] | GPL[3] |
| Beehive Forum | PHP | GPL |
| Discourse | Ruby, JavaScript | GPL |
| Discuz! | PHP | Discuz! EULA |
| eXo Platform | Java | LGPL |
| FluxBB | PHP | GPL |
| FUDforum | PHP | GPL |
| Ikonboard | Perl | Proprietary |
| Invision Power Board | PHP | Proprietary |
| MyBB | PHP | LGPL, moving to BSD in 2.0[14] |
| Phorum | PHP | Phorum License 2 (BSD like) |
| PHPWind | PHP | PHPWind EULA |
| phpBB | PHP | GPL |
| PunBB | PHP | GPL |
| Simple Machines | PHP | BSD License |
| Syndie | Java | Open source, multiple licenses |
| UBB.threads | PHP | Proprietary |
| Vanilla Forums | PHP | Proprietary/GPL[24] |
| vBulletin | PHP[27] | Proprietary[28] |
| Thredded | Ruby | MIT |

It’s working 🎉

---

<div class="post-metadata">

### Author: ![elijah](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elijah/32/104055_2.png) [@elijah](https://meta.discourse.org/u/elijah)
#### Post date: [June 27, 2017, 5:25am UTC](https://meta.discourse.org/t/commonmark-testing-started-here/65121/7 "2017-06-27T05:25:15Z")

</div>

Nesting code fences demo:

````markdown
Here's how to make a code block in markdown:

```cpp
int main(int argc, char** argv) {
return 0;
```

````

And here’s how it’s coded:

`````plaintext
````markdown
Here's how to make a code block in markdown:

```cpp
int main(int argc, char** argv) {
return 0;
```
````

`````

To nest code blocks with a ````` codefence, just keep making outer codefences longer.

Will it nest to arbitrary depths? Six backtick version:

``````plaintext
`````text
````markdown
Here's how to make a code block in markdown:

```cpp
int main(int argc, char** argv) {
return 0;
```
````
`````

``````

And SEVEN!

```````plaintext
``````text
`````text
````markdown
Here's how to make a code block in markdown:

```cpp
int main(int argc, char** argv) {
return 0;
```
````
`````
``````

```````

This is the feature I’ve wanted for quoting things in “how to post in Discourse” messages.

---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [June 27, 2017, 9:12am UTC](https://meta.discourse.org/t/commonmark-testing-started-here/65121/8 "2017-06-27T09:12:27Z")

</div>

I have difficult when I need to insert some code in a post.  
It seems that `[code][/code]` and `<pre></pre>` no longer work.

Will it be permanent or simply have not been implemented yet?

---

<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: [June 27, 2017, 9:31am UTC](https://meta.discourse.org/t/commonmark-testing-started-here/65121/9 "2017-06-27T09:31:41Z")

</div>

Let’s see

```
<pre><code>int main(int argc, char** argv) {
return 0;
</code></pre>

```

```
int main(int argc, char** argv) {
return 0;

```

---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [June 27, 2017, 9:43am UTC](https://meta.discourse.org/t/commonmark-testing-started-here/65121/10 "2017-06-27T09:43:48Z")

</div>

On my forum if I insert `<pre><code> </code></pre>` I 've this result:

 ![7osZAbq](https://global.discourse-cdn.com/meta/original/4X/7/e/f/7ef2a28cc0f8b050b12a54e8563ca6e2d9fab359.png)  
and this is the result when I use only `<pre></pre>` or `<code></code>`

 ![FFweQSt](https://global.discourse-cdn.com/meta/original/4X/6/1/7/617b153a92049678b20690c62c2b7b0857b8e034.png)  
So when commonMark will be fully implemented we need to use only `<pre><code> </code></pre>` ?

---

<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: [June 27, 2017, 2:31pm UTC](https://meta.discourse.org/t/commonmark-testing-started-here/65121/15 "2017-06-27T14:31:49Z")

</div>

Fixed a bunch of edge cases with quoting and bbcode blocks

> [@](#):
>
> nested
> 
> > [@](#):
> >
> > test

quote after a list

- list

> [@](#):
>
> test

```plaintext
Fixed a bunch of edge cases with quoting and bbcode blocks
[quote]
nested
[quote]
test
[/quote]
[/quote]

quote after a list
- list 
[quote]
test
[/quote]

```

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

---

<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: [June 27, 2017, 3:37pm UTC](https://meta.discourse.org/t/commonmark-testing-started-here/65121/17 "2017-06-27T15:37:12Z")

</div>

Nothing really changed with `<pre>` or `<code>` both work exactly as they used to …

```
I am pre-formatted 
   text
```

```plaintext
<pre>
I am pre-formatted 
   text
</pre>

```

It used to work and continues to work.

---

<div class="post-metadata">

### Author: ![elijah](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elijah/32/104055_2.png) [@elijah](https://meta.discourse.org/u/elijah)
#### Post date: [June 27, 2017, 4:17pm UTC](https://meta.discourse.org/t/commonmark-testing-started-here/65121/18 "2017-06-27T16:17:10Z")

</div>

Is there a way to disable a onebox and just show a link? Previously leading whitespace did that, but now that doesn’t seem to work.

```plaintext
vv two spaces
   https://github.com/discourse/discourse/tree/master/app/mailers

```

Shows as

[discourse/app/mailers at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/tree/master/app/mailers)

I did manage to disable with the ugly:

```plaintext
 https://github.com/discourse/discourse/tree/master/app/mailers &nbsp;

```

[discourse/app/mailers at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/tree/master/app/mailers) &nbsp;

But that’s not so easy to type.

---

<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: [June 27, 2017, 4:51pm UTC](https://meta.discourse.org/t/commonmark-testing-started-here/65121/19 "2017-06-27T16:51:09Z")

</div>

It is a bug 🐜 will fix

It may take a day or so cause I need some guidance on the best approach to fix it from @Vitaly

[https://github.com/markdown-it/markdown-it/issues/375](https://github.com/markdown-it/markdown-it/issues/375)

---

<div class="post-metadata">

### Author: ![Vitaly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vitaly/32/120475_2.png) [@Vitaly](https://meta.discourse.org/u/Vitaly)
#### Post date: [June 27, 2017, 7:11pm UTC](https://meta.discourse.org/t/commonmark-testing-started-here/65121/20 "2017-06-27T19:11:58Z")

</div>

Seems i did not understood your question on github, sorry. Now got what you asked about.

I see 2 possible workarounds “in spirit of markdown”

1. Define link text explicit (because such links should not be autoreplaced).
  - Less convenient.

2. Use `<http://...>` [autolink](http://spec.commonmark.org/0.27/#autolinks) (wrap with `<...>`)
  - Easy, but user may wish to use it in very rage case when linkifier fails, to define link borders right. In this case such link will not be oneboxed.

Let me know if that is acceptable. Implementation should be simple - just test more `link_open` token attributes.

---

<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: [June 27, 2017, 7:17pm UTC](https://meta.discourse.org/t/commonmark-testing-started-here/65121/21 "2017-06-27T19:17:26Z")

</div>

Trouble is that users have already been trained for a very long time that

space`http://somelink.com` does not get a onebox.

and

`http://somelink.com` does get a onebox.

It is going to be super painful to teach everyone another option here.

---

<div class="post-metadata">

### Author: ![Vitaly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vitaly/32/120475_2.png) [@Vitaly](https://meta.discourse.org/u/Vitaly)
#### Post date: [June 27, 2017, 7:42pm UTC](https://meta.discourse.org/t/commonmark-testing-started-here/65121/22 "2017-06-27T19:42:06Z")

</div>

> [@sam](#):
>
> It is going to be super painful to teach everyone another option here.

I understand :(. Sometime we should do horrible things, because users are not going to change their habits.

Then try patched paragraph rule (which stores info about trimmed head), as discussed on github. The only disadvantage is - it may be changed in upstream on CM spec update. But you can add test to signal about such change.

---

<div class="post-metadata">

### Author: ![Sean\_R](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sean_r/32/72433_2.png) [@Sean\_R](https://meta.discourse.org/u/Sean_R)
#### Post date: [June 27, 2017, 8:51pm UTC](https://meta.discourse.org/t/commonmark-testing-started-here/65121/23 "2017-06-27T20:51:43Z")

</div>

| | 1 | 2 | 3 | 4 |
| --- | --- | --- | --- | --- |
| Call | 11 | 12 | 11 | 13 |
| Text | 15 | 1 | 5 | 18 |
| Browse | 122 | 2 | 6 | 110 |

---

<div class="post-metadata">

### Author: ![Sean\_R](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sean_r/32/72433_2.png) [@Sean\_R](https://meta.discourse.org/u/Sean_R)
#### Post date: [June 27, 2017, 8:43pm UTC](https://meta.discourse.org/t/commonmark-testing-started-here/65121/24 "2017-06-27T20:43:54Z")

</div>

I wish it showed properly in the preview so I do not have to post this as a topic.

---

<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: [June 27, 2017, 8:52pm UTC](https://meta.discourse.org/t/commonmark-testing-started-here/65121/25 "2017-06-27T20:52:05Z")

</div>

That is a bug, we will get it fixed!

---

<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: [June 27, 2017, 9:02pm UTC](https://meta.discourse.org/t/commonmark-testing-started-here/65121/26 "2017-06-27T21:02:23Z")

</div>

The oneboxing issue is fixed:

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

[Space prior to onebox stops onebox resolution · discourse/discourse@0d62420 · GitHub](https://github.com/discourse/discourse/commit/0d62420cbe443b2cf1061405f83f34eef5103532)

```plaintext
 https://github.com/discourse/discourse/commit/0d62420cbe443b2cf1061405f83f34eef5103532

```

I did want to take a few moments to say 🌞 💃 ☀ to @Vitaly, it is absolutely amazing one can replace core behavior of the new engine in a very tidy and maintainable way without needing to fork the project. I am able to achieve in minutes stuff that used to take me hours when working with the previous Markdown engines.

The [pipeline, date flow and token stream](https://github.com/markdown-it/markdown-it/blob/master/docs/architecture.md) make for an amazingly clear design that is understandable by humans. Thank you.

---

<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: [June 27, 2017, 9:14pm UTC](https://meta.discourse.org/t/commonmark-testing-started-here/65121/27 "2017-06-27T21:14:34Z")

</div>

I enabled the typographer here (with the site setting `enable_markdown_typographer`)

This means that:

```plaintext
(c) (C) (r) (R) (tm) (TM) (p) (P) +-

test.. test... test..... test?..... test!....

!!!!!! ???? ,, -- ---

"Smartypants, double quotes" and 'single quotes'

```

renders as:

(c) (C) (r) (R) ™ ™ (p) (P) ±

test.. test… test… test?.. test!..

!!! ??? , – —

“Smartypants, double quotes” and ‘single quotes’

I do not think we will enable it by default, but some communities have expressed interest in it so … here you go…

---

<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: [June 27, 2017, 9:28pm UTC](https://meta.discourse.org/t/commonmark-testing-started-here/65121/28 "2017-06-27T21:28:06Z")

</div>

I fixed that per:

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

Should be deployed here shortly.

[Next page](https://meta.discourse.org/t/commonmark-testing-started-here/65121.md?page=2)
