CommonMark.NET icon indicating copy to clipboard operation
CommonMark.NET copied to clipboard

Pipe tables are not created when converting to HTML

Open kksathesh opened this issue 7 years ago • 5 comments

I'm trying to convert the below as a table in HTML.

Tables

Option Description
data path to data files to supply the data that will be passed into templates.
engine engine to be used for processing templates. Handlebars is the default.
ext extension to be used for dest files.

Unfortunately, my HTML output is generated as below when using CommonMark.CommonMarkConverter.Convert(...).

Tables

| Option | Description | | ------ | ----------- | | data | path to data files to supply the data that will be passed into templates. | | engine | engine to be used for processing templates. Handlebars is the default. | | ext | extension to be used for dest files. |

kksathesh avatar Nov 08 '18 15:11 kksathesh

MdAndHtml.zip

Added the zip file for reference as GitHub already converted the source md file.

kksathesh avatar Nov 08 '18 16:11 kksathesh

Seems like that should work if you added newlines. Is there a reason you have everything as a single line?

tiesont avatar Nov 09 '18 01:11 tiesont

DesignsInput.zip

As you can see in the attached zip, they are already in newline only. When I paste the content online here at https://dillinger.io/, it displays them properly. When I add additional newline, they are still displayed with pipes, but in new lines. But the tables is not rendered. I'm not sure what I'm missing.

kksathesh avatar Nov 09 '18 19:11 kksathesh

GitHub works fine if you fence the code...

Source:

| Option | Description |
| ------ | ----------- |
| data | path to data files to supply the data that will be passed into templates. |
| engine | engine to be used for processing templates. Handlebars is the default. |
| ext | extension to be used for dest files. |

Rendered by GitHub: (requires one blank line preceding)

Option Description
data path to data files to supply the data that will be passed into templates.
engine engine to be used for processing templates. Handlebars is the default.
ext extension to be used for dest files.

I cannot get CommonMark to render this. It instead renders as:

<p>| Option | Description |
|------ | -----------|
| data | path to data files to supply the data that will be passed into templates. |
| engine | engine to be used for processing templates. Handlebars is the default. |
| ext | extension to be used for dest files. |</p>

VS Code's MarkDown preview also accepted this code.

msftrncs avatar Nov 27 '19 20:11 msftrncs

Is the problem solved?

ySirius avatar Apr 24 '20 02:04 ySirius