Proposal for meta-data (third revision)

Michel Fortin michel.fortin at michelf.com
Thu Jan 11 12:08:47 EST 2007


Le 2007-01-11 à 4:04, Jacob Rus a écrit :


> Andrea Censi wrote:

>> Changes were:

>>

>> * Changed the syntax for compatibility with a future extension

>> mechanism.

>>

>> The first character in the curly braces must be a colon, optionally

>> followed by a space:

>

> I wasn't meaning to suggest before that {«extension-name»

> «content»} was

> necessarily the best syntax for an extension system, but merely

> that it

> was a possibility.


I know I said it before on this list[1][2], but there's already a
supported syntax for this kind of extensions: XML processing
instructions.

<?«processor-name» «content»?>

[1]: http://six.pairlist.net/pipermail/markdown-discuss/2004-April/
000390.html
[2]: http://six.pairlist.net/pipermail/markdown-discuss/2006-June/
000067.html


Processing instructions are passed as-is by Markdown and are pretty
easy to catch later with a simple regex[^1], so it's already possible
to implement this kind of extension when they're not dependent on
Markdown. And I see no reason why some classes of processing
instructions could not be processed by the Markdown parser directly
when that's needed.

[^1]:
You can search for processing instructions to parse in the Markdown
*output* with this regular expression:

/<\?processor-name\b\s*(.*?)\?>/

where you replace "processor-name" with the name of your
extension and
where the first match contains the content for the instruction.


Michel Fortin
michel.fortin at michelf.com
http://www.michelf.com/




More information about the Markdown-Discuss mailing list