Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #139 from DAddYE/master

Redcarpet 2
  • Loading branch information...
commit 10a8ffa0a83f0c38dd243549fa9a32a2e76be6bd 2 parents 7233eef + 87f0358
@rkh rkh authored
View
2  lib/tilt/markdown.rb
@@ -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
View
2  test/tilt_markdown_test.rb
@@ -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
View
9 test/tilt_redcarpettemplate_test.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.