Git 'dashed' commands are deprecated and no longer available with new installs from...
[git-blog.git] / lib / git-blog / parser / markdown.rb
index 1127b6b..bbaefad 100644 (file)
@@ -1,11 +1,33 @@
-require 'redcloth'
+# Maruku
+begin
+  require 'maruku'
+  Markdown = Maruku
+  
+# rpeg-markdown
+rescue LoadError
+  begin
+    require 'markdown'
+  
+  # Discount
+  rescue LoadError
+    begin
+      require 'rdiscount'
+      Markdown = RDiscount
+    
+    # BlueCloth
+    rescue LoadError
+      require 'bluecloth'
+      Markdown = BlueCloth
+    end
+  end
+end
 
 module GitBlog
   module Parsers
     module Markdown
       def self.parse input
         input.gsub!(/^(.*)\n=+(\n\s+)*\n/m, '')
-        ::RedCloth.new(input).to_html # [:markdown, :textile]
+        ::Markdown.new(input).to_html
       end
     end
   end