php-markdown-extra-extended - my humble attempt at extending php-markdown

Alan Hogan contact at alanhogan.com
Wed Jul 13 16:12:40 EDT 2011




On Wednesday, July 13, 2011 at 12:54 PM, David Parsons wrote:


> Adding classes & ids are kind of hideous. What I did with discount

> was to extend the []() syntax to allow class: and id: pseudo-classes

> (like [postoffice](class:caps) or version [2.1.0](id:v2.1.0) on spans

I can’t say I am a fan of this syntax, simply because it uses the same exact syntax for hyperlinks as it does for attributes. The only way to tell about a `mailto:` link and a `class:` attribute is by whitelisting either attributes or protocols (I'm guessing attributes, as protocols are more "unbounded" in quantity). But what about obscure attributes? Or `data-foo-bar` attributes? Would (are) they be supported in this syntax?

More seriously, what if a new technology takes off that uses a protocol designated `id` or similar? Say, a standards-based personal identity URL, e.g. id:alanhogan? Then the two sets of meanings would overlap.

(I also appreciate syntaxes that allow the terseness of # and . for IDs and classes, so familiar to anyone who has ever done CSS or library-assisted JavaScript.)

That said, the ability to apply attributes to spans is pretty cool. Naïvely, I would think a syntax like

blah blah [postoffice]{: .caps}

would make more sense (that is, appropriating inline attribute lists along with the core link text syntax). I don’t see any real ambiguities there, and no need to maintain a whitelist of attributes or protocols, and no possibility to be broken in the future by tech changes outside the realm of Markdown parsers' control.

Alan Hogan

http://blogic.com
contact at alanhogan.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://six.pairlist.net/pipermail/markdown-discuss/attachments/20110713/64797b7c/attachment.htm>


More information about the Markdown-Discuss mailing list