diff --git a/lib/jekyll/converters/markdown/redcarpet_parser.rb b/lib/jekyll/converters/markdown/redcarpet_parser.rb index d43eb140..df18327b 100644 --- a/lib/jekyll/converters/markdown/redcarpet_parser.rb +++ b/lib/jekyll/converters/markdown/redcarpet_parser.rb @@ -6,7 +6,7 @@ module Jekyll module CommonMethods def add_code_tags(code, lang) code = code.to_s - code = code.sub(/
/, "
")
+            code = code.sub(/
/, "
")
             code = code.sub(/<\/pre>/,"
") end end diff --git a/test/test_redcarpet.rb b/test/test_redcarpet.rb index dabcd62c..ebf3b187 100644 --- a/test/test_redcarpet.rb +++ b/test/test_redcarpet.rb @@ -32,7 +32,7 @@ class TestRedcarpet < Test::Unit::TestCase end should "render fenced code blocks with syntax highlighting" do - assert_equal "
puts "Hello world"\n
", @markdown.convert( + assert_equal "
puts "Hello world"\n
", @markdown.convert( <<-EOS ```ruby puts "Hello world" @@ -48,7 +48,7 @@ puts "Hello world" end should "render fenced code blocks with syntax highlighting" do - assert_equal "
puts \"Hello world\"\n
", @markdown.convert( + assert_equal "
puts \"Hello world\"\n
", @markdown.convert( <<-EOS ```ruby puts "Hello world" @@ -64,7 +64,7 @@ puts "Hello world" end should "render fenced code blocks without syntax highlighting" do - assert_equal "
puts "Hello world"\n
", @markdown.convert( + assert_equal "
puts "Hello world"\n
", @markdown.convert( <<-EOS ```ruby puts "Hello world"