RubyでMarkdown記法というと、BlueClothが有名なのではないかと思いますが、rdiscountとrpeg_markdownという新しいライブラリが
Daring Fireball氏のこちらの記事で紹介されていました。
[**Better Markdown Libraries for Ruby: RDiscount and rpeg-markdown**](http://mac.blogdig.net/archives/articles/August2008/17/Better_Markdown_Libraries_for_Ruby__RDiscount_and_rpeg_markdown.html)
>Ryan Tomayko has solved this with two new Ruby extensions that wrap extremely fast (and accurate) C libraries for Markdown: David Loren Parsons’s Discount and Jon MacFarleane’s peg-markdown.
早速
[Formula](http://formula.s21g.com/)
で使ってみようと検証していたのですが、上述の二つのライブラリには、
エスケープの仕方でMARKDOWN記法の解釈に以下のような違いがあるようです。
ruby>>
source = "[test](http://foo.com/?x%3Dx%2B5%2B2y)"
RDiscount.new(source).to_html
#=> "
test
\n"
Markdown.new(source).to_html # rpeg-markdown
#=> "\n\n
test
"
<<--
RDiscountの方は、エスケープ済みのQuery Stringをもう一回エスケープしてしまっているようです。