repo.or.cz
/
git-blog.git
/
blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
raw
|
inline
|
side by side
Git 'dashed' commands are deprecated and no longer available with new installs from...
[git-blog.git]
/
lib
/
git-blog
/
parser
/
markdown.rb
diff --git
a/lib/git-blog/parser/markdown.rb
b/lib/git-blog/parser/markdown.rb
index
553e2cf
..
bbaefad
100644
(file)
--- a/
lib/git-blog/parser/markdown.rb
+++ b/
lib/git-blog/parser/markdown.rb
@@
-1,11
+1,33
@@
-require 'maruku'
+# 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, '')
module GitBlog
module Parsers
module Markdown
def self.parse input
input.gsub!(/^(.*)\n=+(\n\s+)*\n/m, '')
- ::Mar
uku
.new(input).to_html
+ ::Mar
kdown
.new(input).to_html
end
end
end
end
end
end