Question

Take the following snippet of HTML mixed with Markdown.

<section class="section alt">
# Hello
</section>

Translate online with Pandoc using Markdown (strict) -> Html and you get this HTML:

<section class="section alt">
<h1 id="hello">Hello</h1>
</section>

Do the same with MarkdownDeep and you get this HTML:

<p></p><section class="section alt"><p></p>
<h1>Hello</h1>
<p></p></section><p></p>

Notice all the crazy <p> tags!? MarkdownSharp does the same. To be fair, I think Pandoc is off spec here and the other two libraries are probably correct (Update: Pandoc is intentionally off spec here (see comment from John below)). However, the Pandoc approach is much nicer IMO.

Is it possible to make MarkdownDeep or MarkdownSharp behave like Pandoc? If not, is there an alternative .NET markdown implementation/solution that does work like this? (I need to include and ILMerge so can't use Pandoc).

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top