I am using Markdownsharp v1.13.

The following statement:

new Markdown().Transform("<section id=\"archives\">\r\n        <p>\r\n            No archives.\r\n        </p>\r\n</section>")

Is wrapping the result into a p element:

> "<p><section id=\"archives\">\n        <p>\n            No archives.\n
> </p>\n</section></p>\n"

Why on earth is it doing that? I thought it should completely ignore, the html tags?

Thanks for your help.

有帮助吗?

解决方案

The list of block-level elements that prevent Markdown expansions inside them is hardcoded; see line 590 and following.

This list does not include <section> elements by default (when Markdown was created, HTML5 was distant future), but as you can see, you can easily add other HTML tags to that list.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top