Permalink
Browse files

Merge pull request #122 from simulacre/bug-119_redcarpet_extensions

fixes #119: Redcarpet2 has precedence over Redcarpet1
  • Loading branch information...
2 parents 9b67e3a + 3780500 commit 0fd6ddb3bbab30f8615e4716288bfb7c1c7b5408 @rtomayko committed Aug 5, 2012
Showing with 14 additions and 0 deletions.
  1. +2 −0 lib/tilt.rb
  2. +12 −0 test/tilt_markdown_test.rb
View
@@ -173,6 +173,8 @@ def clear
register KramdownTemplate, 'markdown', 'mkd', 'md'
register BlueClothTemplate, 'markdown', 'mkd', 'md'
register RDiscountTemplate, 'markdown', 'mkd', 'md'
+ register RedcarpetTemplate::Redcarpet1, 'markdown', 'mkd', 'md'
+ register RedcarpetTemplate::Redcarpet2, 'markdown', 'mkd', 'md'
register RedcarpetTemplate, 'markdown', 'mkd', 'md'
require 'tilt/textile'
@@ -100,6 +100,18 @@ def test_smarty_pants_true
html = nrender "Hello ``World'' -- This is --- a test ...", :smartypants => true
assert_equal "<p>Hello “World'' – This is — a test …</p>", html
end
+
+ def test_fenced_code_blocks_with_lang
+ code = <<-COD
+ ```ruby
+ puts "hello world"
+ ```
+ COD
+ .gsub(/^\s+/,"")
+
+ html = nrender code, :fenced_code_blocks => true
+ assert_equal %Q{<pre><code class="ruby">puts "hello world"\n</code></pre>}, html
+ end
end
rescue LoadError => boom
# It should already be warned in the main tests

0 comments on commit 0fd6ddb

Please sign in to comment.