Syntax: Markdown processing within block-level HTML

John Gruber gruber at fedora.net
Sat Aug 21 23:01:43 EDT 2004


Michel Fortin <michel.fortin at michelf.com> wrote on 08/21/04 at 1:42pm:

> 2.  Many people would like Markdown to filter what is inside
>      "div" tags. It would be great if there was a simple way to
>      tell Markdown to do this.

There is definitely a need for this, so I'd like to add official
support for it to Markdown 1.1.

This is the input syntax I'm thinking about:

    <div markdown="1">
    Markdown syntax *will* be processed within this div.
    </div>

Which would output:

    <div>
    <p>Markdown syntax <em>will</em> be processed within this div.</p>
    </div>

This 'markdown' pseudo-attribute could be applied to any block-level
tag, not just div. And it would be stripped from the output, since we
obviously wouldn't want it there. No other attributes would be
stripped, so if you could apply classes or IDs to your tags:

    <div class="foo" markdown="1">
    Markdown syntax *will* be processed within this div.
    </div>

Output:

    <div class="foo">
    <p>Markdown syntax <em>will</em> be processed within this div.</p>
    </div>

In fact, I can't think of any reason *not* to support this. It'll be
there if you need it, and will never get in your way if you don't.

-J.G.


More information about the Markdown-discuss mailing list