dprint / dprint-plugin-markdown

Markdown code formatting plugin for dprint.
MIT License
29 stars 9 forks source link

Excess cells in a table row disappear in output #37

Open satyarohith opened 3 years ago

satyarohith commented 3 years ago

Input

| name                                 |                   description                              |
| ------------------------ | ------------------------------ |
| `get(key: name): string | null` | Get the value of the string.             |

Expected output

| name                            | description                  |
| ------------------------------- | ---------------------------- |
| `get(key: name): string | null` | Get the value of the string. |

Actual output

| name                    | description |
| ----------------------- | ----------- |
| `get(key: name): string | null`       |
dsherret commented 3 years ago

I looked into this and the pipe character needs to be escaped within the code block. https://stackoverflow.com/a/17320389/188246

That said, it shouldn't be swallowing the third column.

dsherret commented 3 years ago

Opened https://github.com/raphlinus/pulldown-cmark/issues/520

dsherret commented 3 years ago

It looks like we will have to parse out extra cells manually. Some reading: https://github.github.com/gfm/#tables-extension-

I believe the extra cells could be parsed out, then the cell contents could be reparsed with pulldown-cmark. Kind of sucks though...