rescue block for the method and added redcarpet as option for parser

This commit is contained in:
Parker Moore 2013-04-13 02:13:50 +02:00
parent 3bc497c1c9
commit a971fec801
2 changed files with 21 additions and 23 deletions

View File

@ -19,7 +19,7 @@ module Jekyll
MarukuParser.new @config MarukuParser.new @config
else else
STDERR.puts "Invalid Markdown processor: #{@config['markdown']}" STDERR.puts "Invalid Markdown processor: #{@config['markdown']}"
STDERR.puts " Valid options are [ maruku | rdiscount | kramdown ]" STDERR.puts " Valid options are [ maruku | rdiscount | kramdown | redcarpet ]"
raise FatalException.new("Invalid Markdown process: #{@config['markdown']}") raise FatalException.new("Invalid Markdown process: #{@config['markdown']}")
end end
@setup = true @setup = true

View File

@ -3,7 +3,6 @@ module Jekyll
class Markdown class Markdown
class RedcarpetParser class RedcarpetParser
def initialize(config) def initialize(config)
begin
require 'redcarpet' require 'redcarpet'
@config = config @config = config
@redcarpet_extensions = {} @redcarpet_extensions = {}
@ -28,7 +27,6 @@ module Jekyll
STDERR.puts ' $ [sudo] gem install redcarpet' STDERR.puts ' $ [sudo] gem install redcarpet'
raise FatalException.new("Missing dependency: redcarpet") raise FatalException.new("Missing dependency: redcarpet")
end end
end
def convert(content) def convert(content)
@redcarpet_extensions[:fenced_code_blocks] = !@redcarpet_extensions[:no_fenced_code_blocks] @redcarpet_extensions[:fenced_code_blocks] = !@redcarpet_extensions[:no_fenced_code_blocks]