Skip to content

Commit

Permalink
prefer redcarpet over rdiscount
Browse files Browse the repository at this point in the history
  • Loading branch information
rkh committed Aug 9, 2011
1 parent 8c94d07 commit ebf4883
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/tilt.rb
Expand Up @@ -172,8 +172,8 @@ def clear
register MarukuTemplate, 'markdown', 'mkd', 'md'
register KramdownTemplate, 'markdown', 'mkd', 'md'
register BlueClothTemplate, 'markdown', 'mkd', 'md'
register RedcarpetTemplate, 'markdown', 'mkd', 'md'
register RDiscountTemplate, 'markdown', 'mkd', 'md'
register RedcarpetTemplate, 'markdown', 'mkd', 'md'

require 'tilt/textile'
register RedClothTemplate, 'textile'
Expand Down
16 changes: 13 additions & 3 deletions test/tilt_redcarpettemplate_test.rb
Expand Up @@ -21,9 +21,19 @@ class RedcarpetTemplateTest < Test::Unit::TestCase
%w[md mkd markdown].each do |ext|
mappings = Tilt.mappings[ext]
blue_idx = mappings.index(Tilt::BlueClothTemplate)
rdis_idx = mappings.index(Tilt::RedcarpetTemplate)
assert rdis_idx < blue_idx,
"#{rdis_idx} should be lower than #{blue_idx}"
redc_idx = mappings.index(Tilt::RedcarpetTemplate)
assert redc_idx < blue_idx,
"#{redc_idx} should be lower than #{blue_idx}"
end
end

test "registered above RDiscount" do
%w[md mkd markdown].each do |ext|
mappings = Tilt.mappings[ext]
rdis_idx = mappings.index(Tilt::RDiscountTemplate)
redc_idx = mappings.index(Tilt::RedcarpetTemplate)
assert redc_idx < rdis_idx,
"#{redc_idx} should be lower than #{rdis_idx}"
end
end

Expand Down

0 comments on commit ebf4883

Please sign in to comment.