Permalink
Browse files

Redcarpet2 as default

  • Loading branch information...
1 parent 7233eef commit 87f0358d7e9968c55a28356e2a221d938fc51775 @DAddYE DAddYE committed Feb 23, 2012
Showing with 9 additions and 4 deletions.
  1. +1 −1 lib/tilt/markdown.rb
  2. +1 −1 test/tilt_markdown_test.rb
  3. +7 −2 test/tilt_redcarpettemplate_test.rb
View
@@ -53,7 +53,7 @@ def initialize_engine
end
def prepare
- klass = [Redcarpet1, Redcarpet2].detect { |e| e.engine_initialized? }
+ klass = [Redcarpet2, Redcarpet1].detect { |e| e.engine_initialized? }
@engine = klass.new(file, line, options) { data }
end
@@ -98,7 +98,7 @@ class MarkdownRedcarpetTest < Test::Unit::TestCase
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
+ assert_equal "<p>Hello “World'' – This is — a test …</p>", html
end
end
rescue LoadError => boom
@@ -37,6 +37,11 @@ class RedcarpetTemplateTest < Test::Unit::TestCase
end
end
+ test "redcarpet2 is our default choice" do
+ template = Tilt::RedcarpetTemplate.new {}
+ assert_equal Tilt::RedcarpetTemplate::Redcarpet2, template.prepare.class
+ end
+
test "preparing and evaluating templates on #render" do
template = Tilt::RedcarpetTemplate.new { |t| "# Hello World!" }
assert_equal "<h1>Hello World!</h1>\n", template.render
@@ -48,9 +53,9 @@ class RedcarpetTemplateTest < Test::Unit::TestCase
end
test "smartypants when :smart is set" do
- template = Tilt::RedcarpetTemplate.new(:smart => true) { |t|
+ template = Tilt::RedcarpetTemplate.new(:smartypants => true) { |t|
"OKAY -- 'Smarty Pants'" }
- assert_match /<p>OKAY &[nm]dash; &lsquo;Smarty Pants&rsquo;<\/p>/,
+ assert_match /<p>OKAY &ndash; &#39;Smarty Pants&#39;<\/p>/,
template.render
end
end

1 comment on commit 87f0358

no coment

Please sign in to comment.