Syntax: Markdown processing within block-level HTML

Jesper jesper at lindholms.com
Sun Aug 22 09:30:22 EDT 2004


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

> > 3.    Some tags, like "script" and "math" should not at all be
> >      altered by Markdown. Currently this works only if they are
> >      not in a paragraph, but consider something like this:
> > 
> >          Current time is <script> write_current_time(); </script>.
> > 
> >      It get converted to this (obviously wrong):
> > 
> >          <p>Current time is <script> write<em>current</em>time(); 
> > </script>.</p>
> 
> Good point. I've filed it as a bug. Do you already have a fix 
> for this in PHP?

Why not introduce markdown="0" for any tag, so you won't have to add
exceptions for every possible other ML the user might want to link in,
including home-brewn XML if the user's going to run it through say an XSL
stylesheet? This is no reason not to add new tags like script for the
built-in list by convenience, but it'd be nice if you're doing some of the
extra things. Either that or something like
   
    <markdownskip>script math myownXMLtag b</markdownskip>

to not parse anything in those tags, document-wide.

/Jesper



More information about the Markdown-discuss mailing list