3

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.

John Saunders
  • 160,644
  • 26
  • 247
  • 397
shenku
  • 11,969
  • 12
  • 64
  • 118

1 Answers1

0

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.

balpha
  • 50,022
  • 18
  • 110
  • 131