Paragraphs and html integration.

Boris Le Ninivin boris.leninivin at gmail.com
Tue Jun 19 06:40:42 EDT 2012


On 06/19/2012 02:00 AM, Waylan Limberg wrote:

> On Mon, Jun 18, 2012 at 7:31 PM, Boris Le Ninivin

> <boris.leninivin at gmail.com> wrote:

>> On 06/18/2012 09:27 PM, Michel Fortin wrote:

>>

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

>> 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.

>>

>> Does that mean that<html> and<!doctype> tags will be enclosed between<p>

>> ?

> Yes. More specifically, known block-level tags that would only ever

> appear inside the<body> of a valid HTML4/XHTML1 document are

> recognized by Markdown. So any new tags introduced by HTML5 would also

> not be recognized - although some implementations may be starting to

> add them.

I guess there are valid reasons for that behavior, even if I don't see
them already.

> Also remember that those tags must begin at the start of a line. No

> indentation allowed - or they not recognized as block level tags. Yes,

> this is documented - so most implementations follow it.

Okay. That seems to match what I've seen in the code.

> If your adding<html> stuff to your documents, that is generally

> handled after markdown is run on the body. For example, most

> frameworks and template systems will use a template which generates

> all the stuff outside the<body> and perhaps a header/footer inside

> the body, and then use a template variable to insert the already

> converted markdown into the document.

Well, I really want to have the markdown document containing inclusion
tags. So I'll try the method that Sir Fortin pointed out.

> Markdown does not generally

> expect to have the already generated document run through it -

> although I know some people have had success using it that way in

> specific controlled environments.

I guessed that, that's why I gave up with the idea of replacing any
non-markup content before running the markdown process.

Many thanks you for your help, I'll try to correct my code using your
help and ideas, and I'll tell you if it works :)

Boris.


More information about the Markdown-Discuss mailing list