There's a number of libraries that depend on rdiscount directly, and since there's no "markdown" meta-gem like there is for json, this commit makes a 'java' version of the rdiscount gem that just uses the pure-Ruby Kramdown library.
The rdiscount tests have very specific requirements about HTML formatting, so I wan't quite able to get everything to pass; markdown_test.rb fails 7 tests, and rdiscount_test.rb appears to hang (possibly a JRuby bug). But the output from Kramdown is usually correct "in spirit" if not exactly what rdiscount would produce.
Use Kramdown on JRuby, instead of the C ext.
FWIW, I'm also interested in building a wrapper around some fast Java markdown lib, but on my benchmarks Kramdown on JRuby is only about 50% slower than rdiscount on 1.9.3.
Another approach...markdown_meta gem that prefers rdiscount but uses kramdown as a fallback: https://github.com/headius/markdown_meta
There's a little problem though: kramdown is GPLv3, so not compatible with the BSD license of RDiscount.
I would say that this is a problem for rdiscount. Even Berkeley Systems has switched from the 4 clause to the three clause.
I am not saying that Kramdown is the only solution, I am just looking for JRuby support for 32-bit/64-bit systems
RDiscount is designed as a thin wrapper around the Discount library, not a meta-gem for arbitrary Markdown parsers. Having RDiscount support both Discount and Kramdown would significantly complicate the interface.
Closing as By Design.