HTML::StripScripts and markdown incompatibilities

Louis-David Mitterrand vindex+lists-markdown-discuss at apartia.org
Tue Aug 24 09:41:27 EDT 2010


On Tue, Aug 24, 2010 at 09:34:02AM -0400, Michel Fortin wrote:

> Le 2010-08-24 à 8:49, Louis-David Mitterrand a écrit :

>

> > Actually I save the forum posts to the DB in non-converted markdown and

> > filtered of any unwanted html.

> >

> > Should I save the raw unfiltered post to DB and then (1) expand markdown

> > and (2) filter with StripScripts only when _displaying_ the post? That

> > would entail keeping some potentially "unclean" posts in the DB and

> > having to StripScripts them repeatedly.

>

> The only important thing for correctness of the output is to apply the

> Markdown filter before ScripScripts. The rest is just optimization.

>

> For performance reasons it might be a good idea to save the

> (Markdown+StripScripts)-processed text in the DB, but if you allows

> users to edit their posts once published it'd be more convenient for

> them to have start from the original unprocessed Markdown source. So

> you might want to save either one, or both.


Food for thought :) That's a good suggestion, have a 'source' column
(for edits) in the DB besides the processed 'message' (for display). And
use a DB trigger to update 'message'.

Thanks,

--
http://www.cruisefish.net


More information about the Markdown-Discuss mailing list