PipeTable is not parsed correctly #636

Open
opened 2026-01-29 14:41:45 +00:00 by claunia · 0 comments
Owner

Originally created by @Nareznoy on GitHub (Oct 20, 2023).

Input markdown:

Some paragraph:
|**Heading 1**|**Heading 2**|**Heading 3**|**Heading 4**|
|---|---|---|---|
|Value 1 |Value 2 |Value 3 | |

Expected output HTML:

<p>
   Some paragraph:
</p>
<table>
   <thead>
     <tr>
       <th>
         <strong>
           Heading 1
         </strong>
       </th>
       <th>
         <strong>
           Heading 2
         </strong>
       </th>
       <th>
         <strong>
           Heading 3
         </strong>
       </th>
       <th>
         <strong>
           Heading 4
         </strong>
       </th>
     </tr>
   </thead>
   <tbody>
     <tr>
       <td>
         Value 1
       </td>
       <td>
         Value 2
       </td>
       <td>
         Value 3
       </td>
       <td>
       </td>
     </tr>
   </tbody>
</table>

Actual output HTML:

<p>
   Some paragraph: |<strong>Heading 1
   </strong>|<strong>Heading 2
   </strong>|<strong>Heading 3
   </strong>|<strong>Heading 4
   </strong>| |---|---|---|---| |Value 1 |Value 2 |Value 3 | |
</p>

According to the CommonMark specification -- A sequence of non-blank lines that cannot be interpreted as other kinds of blocks forms a paragraph (https://spec.commonmark.org/0.30/#paragraphs). In this case, the table immediately following the paragraph should be interpreted as a separate block, but it is interpreted as part of the paragraph and, accordingly, is parsed incorrectly

Originally created by @Nareznoy on GitHub (Oct 20, 2023). **Input markdown:** ``` Some paragraph: |**Heading 1**|**Heading 2**|**Heading 3**|**Heading 4**| |---|---|---|---| |Value 1 |Value 2 |Value 3 | | ``` **Expected output HTML:** ``` <p> Some paragraph: </p> <table> <thead> <tr> <th> <strong> Heading 1 </strong> </th> <th> <strong> Heading 2 </strong> </th> <th> <strong> Heading 3 </strong> </th> <th> <strong> Heading 4 </strong> </th> </tr> </thead> <tbody> <tr> <td> Value 1 </td> <td> Value 2 </td> <td> Value 3 </td> <td> </td> </tr> </tbody> </table> ``` **Actual output HTML:** ``` <p> Some paragraph: |<strong>Heading 1 </strong>|<strong>Heading 2 </strong>|<strong>Heading 3 </strong>|<strong>Heading 4 </strong>| |---|---|---|---| |Value 1 |Value 2 |Value 3 | | </p> ``` According to the CommonMark specification -- A sequence of non-blank lines **that cannot be interpreted as other kinds of blocks** forms a paragraph (https://spec.commonmark.org/0.30/#paragraphs). In this case, the table immediately following the paragraph **should be interpreted as a separate block**, but it is interpreted **as part of the paragraph** and, accordingly, is parsed incorrectly
claunia added the wontfix label 2026-01-29 14:41:45 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#636