Marking up abruptly wrapping my html string in a "p" element?
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>")
Wraps the result into a p element:
> "<p><section id=\"archives\">\n <p>\n No archives.\n
> </p>\n</section></p>\n"
Why is this so? I thought it should completely ignore html tags?
Thank you for your help.
+3
source to share
1 answer
The list of block-level elements that prevent Markdown markup within them is hardcoded; see line 590 ff.
This list does not include elements <section>
by default (when Markdown was created, HTML5 was in the distant future), but as you can see, you can easily add other HTML tags to this list.
0
source to share