Order of Markdown and SmartyPants filters (was: Re: Markdown Support in Drupal6.14?)

Michel Fortin michel.fortin at michelf.com
Thu Oct 22 16:30:00 EDT 2009

Le 2009-10-22 à 13:29, Joonas Pulakka a écrit :

> 2009/10/20 Lou Quillio <public at quillio.com>


>> On Mon, Oct 19, 2009 at 3:20 PM, AJG Baeumel

>> <ajgb at st-maurices.n-lanark.sch.uk> wrote:

>>> Why is Marksmarty no longersupported in Drupal 6.14?


>> It's been a while since I've worked with Drupal, but I remember that

>> MarkSmarty was really just a hybrid convenience filter. It's better

>> to

>> apply the SmartyPants and Markdown filters (in that order) to your

>> content, and update them by dropping-in Michel's latest PHP libs if

>> the Drupal-supplied ones fall out of date.



> I'm now puzzled which is the correct order to apply the filters.

> SmartyPants

> first and Markdown then (as above), or the other way round (as you

> suggested

> a couple of months ago :-)?

> http://six.pairlist.net/pipermail/markdown-discuss/2009-September/001647.html

Markdown, then Smartypants. If you run Smartypants first, it'll
convert characters like quotes to curly ones in link definitions and
code samples, and the result won't be processed correctly by the
Markdown filter. Smartypants wants HTML-formatted input, not Markdown-
formatted input.

This is documented in the PHP Markdown Readme:

> If you wish to use PHP Markdown with another text filter function

> built to parse HTML, you should filter the text *after* the Markdown

> function call. This is an example with PHP SmartyPants:


> $my_html = SmartyPants(Markdown($my_text));

Michel Fortin
michel.fortin at michelf.com

More information about the Markdown-Discuss mailing list