Issue while trying to convert markdown to Html ( with pipelines) #276

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

Originally created by @Matteo7497 on GitHub (Mar 7, 2019).

Hello,
I'm trying to convert some markdown to html using this code:

var pipeline = new MarkdownPipelineBuilder();
MarkdownPipeline markdownPipeline = pipeline.UseAdvancedExtensions().UsePipeTables().Build();
StringWriter tw = new StringWriter();
MarkdownObject doc = Markdown.ToHtml(markdown, tw, markdownPipeline);

After that i have to update links in the Markup from relative to absolute paths.
So, after that i'm trying to convert the MarkdownObject to string using this code:

var builder = new StringBuilder();
var textwriter = new StringWriter(builder);
var renderer = new HtmlRenderer(textwriter);
var t = renderer.Render(doc);
return builder.ToString();

so what?
Pipe Tables are parsed as paragraphs.

Some example:

| abc | def | ghi |
|---|---|---|
| 1 | 2 | 3 |

this markdown table is parsed as:

<p>abc</p>
<p>def</p>
<p>ghi</p>
<p>1</p>
<p>2</p>
<p>3</p>

However if i use this code everthing works (but i can't update links in an easy way)

string html = Markdown.ToHtml(markdown, markdownPipeline);

How can i convert this markdown?
Thank you so much.

Originally created by @Matteo7497 on GitHub (Mar 7, 2019). Hello, I'm trying to convert some markdown to html using this code: ``` var pipeline = new MarkdownPipelineBuilder(); MarkdownPipeline markdownPipeline = pipeline.UseAdvancedExtensions().UsePipeTables().Build(); StringWriter tw = new StringWriter(); MarkdownObject doc = Markdown.ToHtml(markdown, tw, markdownPipeline); ``` After that i have to update links in the Markup from relative to absolute paths. So, after that i'm trying to convert the MarkdownObject to string using this code: ``` var builder = new StringBuilder(); var textwriter = new StringWriter(builder); var renderer = new HtmlRenderer(textwriter); var t = renderer.Render(doc); return builder.ToString(); ``` so what? Pipe Tables are parsed as paragraphs. Some example: ``` | abc | def | ghi | |---|---|---| | 1 | 2 | 3 | ``` this markdown table is parsed as: ``` <p>abc</p> <p>def</p> <p>ghi</p> <p>1</p> <p>2</p> <p>3</p> ``` However if i use this code everthing works (but i can't update links in an easy way) `string html = Markdown.ToHtml(markdown, markdownPipeline); ` How can i convert this markdown? Thank you so much.
claunia added the questioninvalid labels 2026-01-29 14:32:35 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#276