-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3167241
commit 7f07e67
Showing
2 changed files
with
31 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,34 @@ | ||
require 'maruku' | ||
# rpeg-markdown | ||
begin | ||
require 'markdown' | ||
|
||
# Discount | ||
rescue LoadError | ||
begin | ||
require 'rdiscount' | ||
Markdown = RDiscount | ||
|
||
# Maruku | ||
rescue LoadError | ||
begin | ||
require 'maruku' | ||
Markdown = Maruku | ||
|
||
# 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, '') | ||
::Maruku.new(input).to_html | ||
::Markdown.new(input).to_html | ||
end | ||
end | ||
end | ||
end | ||
|
||
end |