Paragraphs and html integration.

Waylan Limberg waylan at gmail.com
Mon Jun 18 11:53:15 EDT 2012


On Mon, Jun 18, 2012 at 6:26 AM, Boris Le Ninivin
<boris.leninivin at gmail.com> wrote:

> Hello everyone.

>

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

[snip]

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

>


First, I should point out that while "Markdown is smart enough not to
add extra (unwanted) <p> tags around HTML block-level tags" that only
applies to *known* (and valid) HTML block level tags. "@include
filename" is *not* a known HTML block-level tag - its not even HTML at
all.

I'm not sure how you implemented your inclusion stuff, but here's a
few suggestions:

If you are swapping your inclusion tag after markdown is run, then you
need to match your inclusion tag wrapped inside a paragraph. Match
this: `<p>@include filename</p>`.

If you are swapping your inclusion tag before markdown is run, then we
need to see what was swapped in to be of any help.

If you have modified markdown (or used PHP Markdown's undocumented
extension support), make sure your addition is running before raw HTML
is handled by the parser.

--
----
\X/ /-\ `/ |_ /-\ |\|
Waylan Limberg


More information about the Markdown-Discuss mailing list