Creating Tables #402

Closed
opened 2026-01-29 14:35:51 +00:00 by claunia · 3 comments
Owner

Originally created by @SoftCircuits on GitHub (Sep 27, 2020).

I've been successfully using MarkdownSharp for a while now but was hoping to get some more sophisticated support for things like tables.

So I tried the following code:

var pipeline = new MarkdownPipelineBuilder().UseAdvancedExtensions().Build();
ArticlePreview preview = new ArticlePreview(txtTitle.Text, DateTime.Today.ToString("d"), Markdig.Markdown.ToHtml(txtArticle.Text, pipeline), tglDeprecated.IsChecked ?? false);

And I tried to create a simple table:

|---|---|
| abc | def |
|---|---|

The the text above is not converted to a table.

Is this supported? What am I missing?

Originally created by @SoftCircuits on GitHub (Sep 27, 2020). I've been successfully using MarkdownSharp for a while now but was hoping to get some more sophisticated support for things like tables. So I tried the following code: ```cs var pipeline = new MarkdownPipelineBuilder().UseAdvancedExtensions().Build(); ArticlePreview preview = new ArticlePreview(txtTitle.Text, DateTime.Today.ToString("d"), Markdig.Markdown.ToHtml(txtArticle.Text, pipeline), tglDeprecated.IsChecked ?? false); ``` And I tried to create a simple table: ``` |---|---| | abc | def | |---|---| ``` The the text above is not converted to a table. Is this supported? What am I missing?
Author
Owner

@rjgamble commented on GitHub (Oct 23, 2020):

I think your markdown is missing a header definition. See below example:

| Header 1 | Header 2 |
| -------- | -------- |
| data 1 | data 2 |

Result in GitHub comment:

Header 1 Header 2
data 1 data 2
@rjgamble commented on GitHub (Oct 23, 2020): I think your markdown is missing a header definition. See below example: ``` | Header 1 | Header 2 | | -------- | -------- | | data 1 | data 2 | ``` Result in GitHub comment: | Header 1 | Header 2 | | -------- | -------- | | data 1 | data 2 |
Author
Owner

@nhamawi commented on GitHub (May 7, 2021):

I spent several hours trying to get Markdig to convert a markdown table to HTML and I'm getting only rows of text wrapped in < p > and < /p >. I'm using c#, Visual Studio 2019, and Markdig 0.24.0 from nuget. I'm creating a new MarkdownPipelineBuilder and adding .UsePipeTables(), but still no luck. The behavior is as if it's enforcing strict commonmark syntax which does not allow tables to be defined by using pipe symbols. I see no way to disable strict mode. However, I see documentation on this site for supporting pipe-based markup. Babelmark III also confirms that Markdig cannot support pipe-based markup which is in contrast to the documentation as I have pasted Markdig's own samples there and get the same (unexpected) result.

@nhamawi commented on GitHub (May 7, 2021): I spent several hours trying to get Markdig to convert a markdown table to HTML and I'm getting only rows of text wrapped in < p > and < /p >. I'm using c#, Visual Studio 2019, and Markdig 0.24.0 from nuget. I'm creating a new MarkdownPipelineBuilder and adding .UsePipeTables(), but still no luck. The behavior is as if it's enforcing strict commonmark syntax which does not allow tables to be defined by using pipe symbols. I see no way to disable strict mode. However, I see documentation on this site for supporting pipe-based markup. Babelmark III also confirms that Markdig cannot support pipe-based markup which is in contrast to the documentation as I have pasted Markdig's own samples there and get the same (unexpected) result.
Author
Owner

@xoofx commented on GitHub (May 7, 2021):

@nhamawi open a new issue and post the exact markdown text you are using so that we can reproduce the behaviour.

@xoofx commented on GitHub (May 7, 2021): @nhamawi open a new issue and post the exact markdown text you are using so that we can reproduce the behaviour.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#402