Adding a "Safe" option?
Jason Clark
jason at jclark.org
Mon Apr 26 21:20:27 EDT 2004
Okay, I know that the current goal is the 1.0 release, and I know that
a stated goal of MD is simplicity (no feature creep). However, I'm
thinking of modifying my MD for my own use, and I'd like to think out
loud here a bit, and maybe get some feedback. If you're a purist,
please avert your eyes ;-).
I'd like to use Markdown on my site to format comments. (FWIW, mine is
a Blosxom blog, not MT.) Additionally, I do not want to allow any raw
HTML to beentered in comments. Only Markup-generated XHTML will be
allowed. However, I can't just strip anything that looks like html
before passing it to markup, since I want to allow code samples to
contain HTML. Since Markup already understands code blocks, It makes
sense to me to put the scrubbing code inside Markdown and make it a
configurable option. If I do this, I have a choice of two ways to
handle user-entered HTML: I can either strip it, or `treat it like a
code span`. Couple this with a mandatory preview before posting a
comment, and I think my comment system will be simple yet powerful.
For lack of a better term, I've been calling this a "safe" option.
Does this sound useful? If I get this to work, I'll of course publish
the patch. Am I overlooking anything, functionality-wise? I've only
browsed the full source, so I haven't quite determined how I'll
accomplish this, but I think that MD's methodical parsing strategy
should work to my advantage.
Jason Clark <jason at jclark.org>
http://jclark.org/weblog/
More information about the Markdown-discuss
mailing list