Paragraphs and html integration.

Michel Fortin michel.fortin at
Mon Jun 18 15:27:22 EDT 2012

Le 2012-06-18 à 6:26, Boris Le Ninivin a écrit :

> Now, to step forward to the problem I have :


> In a website, parts of the pages (essentially headers and footers) are often the same. Hence I've added a functionality to my toolkit : inclusion. It is performed when the parser finds "@include filename".


> The problem I have had is that these instructions are wrapped between <p> tags. Indeed I've tried to bypass the problem by many ideas, but since EVERYTHING is wrapped between <p> tags (including doctypes and all!), I get non-compliant html documents (my header defines the doctype and html head body tags too; and my footer closes the body and html tags; but these are wrapped into paragraphs...).


> Since the markdown language is aimed to be "a format for /writing/ for the web." and "not a replacement for HTML, or even close to it.", I think the md language should allow a strong usage of html tags, and even, to have .md files containing 99% of html tags.

Except @include is not an HTML tag at all.

You could instead use XML-style processing instructions, such as <?include blah blah ?>. PHP Markdown should handle them fine regardless of where you put them.

> In the end, on the df website, it is said that "Markdown is smart enough not to add extra (unwanted) |<p>| tags around HTML block-level tags.". So I don't know if it's an implementation problem (related to the PHP port, maybe?), or if it's a design problem, but as far as I know, Markdown is not smart enough to not add unwanted <p> tags.

That's only true for known HTML tags, and only the block-level ones.

> [1] I'm not really delighted to see that a GOOGLE email address is required to be able to post to this list. It might be a more or less effective way to reduce spam, but it's clearly not the correct one. Google uses the data from your emails to build profiles on you, and to [identify]( and [bubble]( you. Therefore, I use a personal email address from a domain I own. And that one was rejected. I just wanted to point all that out while I'm at it. Oh and in case I'm wrong and that it was my domain which is blacklisted or anything else, do not pay attention to this complaint. :)

As far as I know, the only requirement is that you need to post using the address you subscribed with.

Michel Fortin
michel.fortin at

More information about the Markdown-Discuss mailing list