diff --git a/Rakefile b/Rakefile index 062e398..af69443 100644 --- a/Rakefile +++ b/Rakefile @@ -13,7 +13,7 @@ begin gem.add_development_dependency "riot" gem.add_dependency "builder" gem.add_dependency "rack" - if RUBY_PLATFORM =~ /win32/ + if RUBY_PLATFORM =~ /win32|java/ gem.add_dependency "maruku" else gem.add_dependency "rdiscount" diff --git a/lib/toto.rb b/lib/toto.rb index d74b920..faf264a 100644 --- a/lib/toto.rb +++ b/lib/toto.rb @@ -5,9 +5,8 @@ require 'digest' require 'open-uri' -if RUBY_PLATFORM =~ /win32/ +if RUBY_PLATFORM =~ /win32|java/ require 'maruku' - Markdown = Maruku else require 'rdiscount' end @@ -41,7 +40,11 @@ def to_html page, config, &blk def markdown text if (options = @config[:markdown]) - Markdown.new(text.to_s.strip, *(options.eql?(true) ? [] : options)).to_html + if RUBY_PLATFORM =~ /win32|java/ + Maruku.new(text.to_s.strip).to_html + else + Markdown.new(text.to_s.strip, *(options.eql?(true) ? [] : options)).to_html + end else text.strip end