Merge pull request #1799 from konklone/maruku_fenced_code_blocks

This commit is contained in:
Matt Rogers 2013-12-10 20:30:44 -08:00
commit a7d4ee8bfb
2 changed files with 24 additions and 0 deletions

View File

@ -8,6 +8,10 @@ module Jekyll
@errors = []
load_divs_library if @config['maruku']['use_divs']
load_blahtext_library if @config['maruku']['use_tex']
# allow fenced code blocks (new in Maruku 0.7.0)
MaRuKu::Globals[:fenced_code_blocks] = !!@config['maruku']['fenced_code_blocks']
rescue LoadError
STDERR.puts 'You are missing a library required for Markdown. Please run:'
STDERR.puts ' $ [sudo] gem install maruku'

View File

@ -451,5 +451,25 @@ CONTENT
assert_match "<span id='include-param' />", @result
end
end
context "with fenced code blocks with backticks" do
setup do
content = <<CONTENT
```ruby
puts "Hello world"
```
CONTENT
create_post(content, {
'maruku' => {'fenced_code_blocks' => true}}
)
end
# todo: if #112 is merged into maruku, update to remove the newlines inside code block
should "render fenced code blocks" do
assert_match %r{<pre class=\"ruby\"><code class=\"ruby\">\nputs &quot;Hello world&quot;\n</code></pre>}, @result.strip
end
end
end
end