From 4ae8fefb9519fe81d27b742b63dbebbedd60c8e9 Mon Sep 17 00:00:00 2001 From: Valery Tolstov Date: Sat, 3 May 2014 20:23:28 +0400 Subject: [PATCH 1/2] Remove literal lang name from class, fix #2284 If code language is C classes for comment and language are the same --- lib/jekyll/converters/markdown/redcarpet_parser.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From cf4304ab2b8424b5c33dc2bcfc0fa76b7cac7124 Mon Sep 17 00:00:00 2001 From: Valery Tolstov Date: Sat, 3 May 2014 21:46:16 +0400 Subject: [PATCH 2/2] Update tests Remove language literal from class in test/test_redcarpet.rb --- test/test_redcarpet.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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"