Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple table normalization strips all table symbols #651

Closed
ricardoboss opened this issue Jul 27, 2022 · 3 comments
Closed

Simple table normalization strips all table symbols #651

ricardoboss opened this issue Jul 27, 2022 · 3 comments

Comments

@ricardoboss
Copy link

Hi, great project!

I use markdig in a project to normalize incoming Markdown files and to gather metadata about the document. Now some of these documents include tables and I noticed that they are not rendered at all (I use a JS renderer for markdown, but that one works just fine). As it turns out, markdig seems to strip all table symbols in the normalization step.

I have a reproduction, which closely resembles the actual code used: https://github.com/ricardoboss/markdig-table-normalization

The gist of it is this:

Program.cs

var markdownPipeline = new MarkdownPipelineBuilder()
    .UsePipeTables()
    .Build();

var content = File.ReadAllText("test.md");
var document = Markdown.Parse(content, markdownPipeline);
var builder = new StringBuilder();
var writer = new StringWriter(builder);
var renderer = new NormalizeRenderer(writer);
renderer.Render(document);

Console.Write(builder.ToString());

test.md

| Col | Col 2 | Col 3 |
|:----|:-----:|------:|
| left | center | right |
| spaaaaaaaaacer | spaaaaaaaaacer | spaaaaaaaaacer |

And I expected the output to be same or somewhat formatted, but the actual output is this:

ColCol 2Col 3leftcenterrightspaaaaaaaaacerspaaaaaaaaacerspaaaaaaaaacer
@MihaZupan
Copy link
Collaborator

MihaZupan commented Jul 27, 2022

I think you are just missing a pipeline.Setup(renderer) call to add the renderer for tables.

Edit: On second thought, I don't think we have a normalization renderer for tables at all.
Normalization is way less polished than Html, and isn't implemented for most extensions.

@chucker
Copy link

chucker commented Jul 27, 2022

#155 doesn't list tables yet, so it might simply not be implemented at this point.

@MihaZupan
Copy link
Collaborator

Duplicate of #155

@MihaZupan MihaZupan marked this as a duplicate of #155 Aug 2, 2022
@MihaZupan MihaZupan closed this as not planned Won't fix, can't repro, duplicate, stale Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants