Merge pull request #1799 from konklone/maruku_fenced_code_blocks
This commit is contained in:
commit
a7d4ee8bfb
|
@ -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'
|
||||
|
|
|
@ -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 "Hello world"\n</code></pre>}, @result.strip
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue