# CommonMark testing started here!

**URL:** https://meta.discourse.org/t/commonmark-testing-started-here/65121
**Category:** Feature
**Created:** [2017年六月26日 12:44 UTC](https://meta.discourse.org/t/commonmark-testing-started-here/65121 "2017-06-26T12:44:40Z")
**Posts on this page:** 18
**Page:** 6

<div class="post-metadata">

### Author: ![fantasticfears](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fantasticfears/32/119608_2.png) [@fantasticfears](https://meta.discourse.org/u/fantasticfears)
#### Post date: [2017年七月15日 16:28 UTC](https://meta.discourse.org/t/commonmark-testing-started-here/65121/110 "2017-07-15T16:28:35Z")

</div>

Per CJK, I found a corner case though I believe it’s in the spec somehow. I am full of surprised when I meet this case.

> 测试\*\*fun()\*\*可以
> 
> 测试 **fun** 可以
> 
> 测试**fun()可以  
> 测试fun**可以

I would rather expect:

> 测试**fun()**可以
> 
> 测试 **fun** 可以
> 
> 测试**fun()**可以  
> 测试 **fun** 可以

The test code is:

```md
测试**fun()**可以

测试 **fun** 可以

测试**fun()**可以
测试 **fun** 可以

```

---

<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: [2017年七月17日 14:06 UTC](https://meta.discourse.org/t/commonmark-testing-started-here/65121/111 "2017-07-17T14:06:55Z")

</div>

We are behaving according to spec here:

[https://johnmacfarlane.net/babelmark2/?text=\>+测试\*\*fun()\*\*可以 \>+ \>+测试\*\*fun\*\*可以 \>+ \>+测试\*\*fun()\*\*可以 \>+测试\*\*fun\*\*可以](https://johnmacfarlane.net/babelmark2/?text=%3E+%E6%B5%8B%E8%AF%95**fun()**%E5%8F%AF%E4%BB%A5%0A%3E+%0A%3E+%E6%B5%8B%E8%AF%95 **fun** %E5%8F%AF%E4%BB%A5%0A%3E+%0A%3E+%E6%B5%8B%E8%AF%95**fun()**%E5%8F%AF%E4%BB%A5%0A%3E+%E6%B5%8B%E8%AF%95 **fun** %E5%8F%AF%E4%BB%A5%0A)

Have you tried opening an issue about this on [talk.commonmark.org](http://talk.commonmark.org)

---

<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: [2017年七月17日 14:08 UTC](https://meta.discourse.org/t/commonmark-testing-started-here/65121/112 "2017-07-17T14:08:10Z")

</div>

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

```plaintext
 :email, class_name: is not an emoji... 

```

---

<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: [2017年七月18日 00:40 UTC](https://meta.discourse.org/t/commonmark-testing-started-here/65121/113 "2017-07-18T00:40:38Z")

</div>

FYI I fixed all the edge cases reported and deployed the fixes

---

<div class="post-metadata">

### Author: ![fantasticfears](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fantasticfears/32/119608_2.png) [@fantasticfears](https://meta.discourse.org/u/fantasticfears)
#### Post date: [2017年七月18日 09:31 UTC](https://meta.discourse.org/t/commonmark-testing-started-here/65121/114 "2017-07-18T09:31:10Z")

</div>

Sure, I posted a question there just now. For the record, it’s here. [`测试 **foo** 可以` works but `测试**foo()**可以` fails - Spec - CommonMark Discussion](https://talk.commonmark.org/t/foo-works-but-foo-fails/2528)

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [2017年七月23日 17:54 UTC](https://meta.discourse.org/t/commonmark-testing-started-here/65121/116 "2017-07-23T17:54:09Z")

</div>

There seems to be a regression with HTML table support since the move to markdown.

The following used to work:

```plaintext
<table>
  <tr>
    <th>Markdown</th>
    <th>BBCode</th>
    <th>HTML</th>
  </tr>
  <tr>
    <td> <pre>
1. Item 1
1. Item 2
 1. Nested Item 1
 1. Nested Item 2
1. Item 3
</pre> </td>
    <td> <pre>
[ol]
  [li]Item 1[/li]
  [li]Item 2[/li]
    [ol]
      [li]Nested item 1[/li]
      [li]Nested item 2[/li]
    [/ol]
  [li]Item 3[/li]
[/ol]
</pre> </td>
    <td>
<pre>
<ol>
  <li>Item 1</li>
  <li>Item 2</li>
    <ol>
      <li>Nested item 1</li>
      <li>Nested item 2</li>
    </ol>
  <li>Item 3</li>
</ol>
</pre> </td>
  </tr>
</table>

```

However, the HTML is now rendered with very strange spacing (see below). The only solution I could find was to replace the `<` with `&lt;` and `>` with `&gt;` to avoid the HTML.

| Markdown | BBCode | HTML |
| --- | --- | --- |
|  
```
1. Item 1
1. Item 2
 1. Nested Item 1
 1. Nested Item 2
1. Item 3
```
  |  
```
[ol]
  [li]Item 1[/li]
  [li]Item 2[/li]
    [ol]
      [li]Nested item 1[/li]
      [li]Nested item 2[/li]
    [/ol]
  [li]Item 3[/li]
[/ol]
```
  | 
```
1. Item 1
2. Item 2

  1. Nested item 1
  2. Nested item 2

3. Item 3
```
  |

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [2017年七月23日 22:42 UTC](https://meta.discourse.org/t/commonmark-testing-started-here/65121/117 "2017-07-23T22:42:00Z")

</div>

An `<ol>` as a child of an `<ol>` isn’t valid HTML so it can’t be expected to display correctly

[\<ol\> HTML ordered list element - HTML | MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ol)

```plaintext
<ol>
  <li>first item</li>
  <li>second item <!-- closing </li> tag not here! -->
    <ol>
      <li>second item first subitem</li>
      <li>second item second subitem</li>
      <li>second item third subitem</li>
    </ol>
  </li> <!-- Here's the closing </li> tag -->
  <li>third item</li>
</ol>

```

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [2017年七月24日 02:31 UTC](https://meta.discourse.org/t/commonmark-testing-started-here/65121/118 "2017-07-24T02:31:33Z")

</div>

Interesting…so the CommonMark switched _fixed_ bad HTML processing? I had the same issue with an unordered list - do I have bad HTML here too?

| Markdown | BBCode | HTML |
| --- | --- | --- |
|  
```
* Item 1 - Item 1 + Item 1
* Item 2 or - Item 2 or + Item 2
* Item 3 - Item 3 + Item 3
```
 |  
```
[ul]
  [li]Item 1[/li]
  [li]Item 2[/li]
  [li]Item 3[/li]
[/ul]
```
 |  
```

```

- Item 1
- Item 2
- Item 3

 |

```plaintext
<table>
  <tr>
    <th>Markdown</th>
    <th>BBCode</th>
    <th>HTML</th>
  </tr>
  <tr>
    <td> <pre>* Item 1 - Item 1 + Item 1
* Item 2 or - Item 2 or + Item 2
* Item 3 - Item 3 + Item 3</pre></td>
    <td> <pre>
[ul]
  [li]Item 1[/li]
  [li]Item 2[/li]
  [li]Item 3[/li]
[/ul]
</pre></td>
<td> <pre>
<ul>
  <li>Item 1</li>
  <li>Item 2</li>
  <li>Item 3</li>
</ul>
</pre></td>
  </tr>
</table>

```

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [2017年七月24日 08:45 UTC](https://meta.discourse.org/t/commonmark-testing-started-here/65121/120 "2017-07-24T08:45:45Z")

</div>

The `<ul>` example you posted doesn’t have a nested `<ul>` (if it did, it would be the same. `<dl>` too)

Discourse may have done / be doing some correction of mark-up, but AFAIK, it is often the browser that “fixes” it. Some may add a tag where they think one should be, others may remove tags where they think one should not be, they might ignore tags, etc. Testing pages in multiple browsers can reveal “it looks good in x and y browser, but bad in z browser” problems, but IMHO using the W3C validator [https://validator.w3.org/](https://validator.w3.org/) is one of, if not _the_ best ways to ensure consistency.

---

<div class="post-metadata">

### Author: ![tophee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tophee/32/73406_2.png) [@tophee](https://meta.discourse.org/u/tophee)
#### Post date: [2017年八月13日 23:59 UTC](https://meta.discourse.org/t/commonmark-testing-started-here/65121/121 "2017-08-13T23:59:08Z")

</div>

Is this rendering correctly:

```
<strike>some text </strike> some more text

```

It comes out lije this:  
~~some text~~ some more text

I would expect it to render like this:  
~~some text~~ some more text

---

<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: [2017年八月14日 00:04 UTC](https://meta.discourse.org/t/commonmark-testing-started-here/65121/122 "2017-08-14T00:04:11Z")

</div>

Why, that is how HTML renders it?

---

<div class="post-metadata">

### Author: ![tophee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tophee/32/73406_2.png) [@tophee](https://meta.discourse.org/u/tophee)
#### Post date: [2017年八月14日 00:05 UTC](https://meta.discourse.org/t/commonmark-testing-started-here/65121/123 "2017-08-14T00:05:05Z")

</div>

Okay, if that is so, I rest my case.

---

<div class="post-metadata">

### Author: ![rriemann](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rriemann/32/115238_2.png) [@rriemann](https://meta.discourse.org/u/rriemann)
#### Post date: [2017年八月15日 13:51 UTC](https://meta.discourse.org/t/commonmark-testing-started-here/65121/124 "2017-08-15T13:51:58Z")

</div>

I have a html-related issue. My discourse is also a commenting system and imports using an rss feed html.

```plaintext

<div><div>
      <p>blabla</p>
        
      
    </div></div>

<hr>
<small>This is a companion discussion topic for the original entry at <a href="#">url</a></small>

```

The following code is rendered in the forum as follows. The closing divs are interpreted as code instead of html. Is this not supported anymore by the new markdown engine or is this a bug?

### Preview:

blabla

```
</div></div>

```

* * *
This is a companion discussion topic for the original entry at url

---

<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: [2017年八月15日 13:57 UTC](https://meta.discourse.org/t/commonmark-testing-started-here/65121/125 "2017-08-15T13:57:15Z")

</div>

> [@rriemann](#):
>
> \</div\>\</div\>

SPACESPACESPACESPACEAnything

Is a code block per CommonMark spec, it has been like this for many many years.

---

<div class="post-metadata">

### Author: ![rriemann](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rriemann/32/115238_2.png) [@rriemann](https://meta.discourse.org/u/rriemann)
#### Post date: [2017年八月15日 14:12 UTC](https://meta.discourse.org/t/commonmark-testing-started-here/65121/126 "2017-08-15T14:12:47Z")

</div>

However, it is not safe to assume that no html content pulled in via an RSS feed will never use such a combo. So couldn’t Discourse strip redundant spaces in the html code before posting the content into 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: [2017年八月15日 14:17 UTC](https://meta.discourse.org/t/commonmark-testing-started-here/65121/127 "2017-08-15T14:17:17Z")

</div>

It depends if the RSS feed is HTML or Markdown, we have a component that we use to convert HTML to Markdown for incoming email, it is possible it could be leveraged here optionally. But… I do not think this belongs in this discussion, instead open a new topic with detailed information about the problem and suggested solutions.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2017年八月15日 14:18 UTC](https://meta.discourse.org/t/commonmark-testing-started-here/65121/128 "2017-08-15T14:18:27Z")

</div>

How would Discourse know if those extra spaces were there on purpose or because some HTML generator just loves spaces?

Can you fix the thing generating the HTML not to have four spaces at the beginning of a line? That seems like the place to fix.

---

<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: [2017年十二月2日 09:05 UTC](https://meta.discourse.org/t/commonmark-testing-started-here/65121/129 "2017-12-02T09:05:25Z")

</div>



[上一頁](https://meta.discourse.org/t/commonmark-testing-started-here/65121.md?page=5)
