diff --git a/Gemfile b/Gemfile index 0dcce3c48dd..faa90800292 100644 --- a/Gemfile +++ b/Gemfile @@ -70,7 +70,7 @@ group :jekyll_optional_dependencies do gem "jekyll-gist" gem "jekyll-paginate" gem "jekyll-redirect-from" - gem "kramdown", "~> 1.9" + gem "kramdown", "~> 1.14", ">= 1.14.0" gem "mime-types", "~> 3.0" gem "rdoc", "~> 5.0" gem "toml", "~> 0.1.0" diff --git a/jekyll.gemspec b/jekyll.gemspec index a8bd05eabab..ac40352f3a5 100644 --- a/jekyll.gemspec +++ b/jekyll.gemspec @@ -34,7 +34,7 @@ Gem::Specification.new do |s| s.add_runtime_dependency("colorator", "~> 1.0") s.add_runtime_dependency("jekyll-sass-converter", "~> 1.0") s.add_runtime_dependency("jekyll-watch", "~> 1.1") - s.add_runtime_dependency("kramdown", "~> 1.3") + s.add_runtime_dependency("kramdown", "~> 1.14", ">= 1.14.0") s.add_runtime_dependency("liquid", "~> 4.0") s.add_runtime_dependency("mercenary", "~> 0.3.3") s.add_runtime_dependency("pathutil", "~> 0.9") diff --git a/test/test_tags.rb b/test/test_tags.rb index 81fbf8308ef..2add6098d04 100644 --- a/test/test_tags.rb +++ b/test/test_tags.rb @@ -343,6 +343,42 @@ def highlight_block_with_opts(options_string) end end + context "post content has raw tag" do + setup do + content = <<-CONTENT +--- +title: This is a test +--- + +```liquid +{% raw %} +{{ site.baseurl }}{% link _collection/name-of-document.md %} +{% endraw %} +``` +CONTENT + create_post(content) + end + + should "render markdown with rouge 1" do + skip "Skipped because using a newer version of Rouge" unless Utils::Rouge.old_api? + + assert_match( + %(
),
+          @result
+        )
+      end
+
+      should "render markdown with rouge 2" do
+        skip "Skipped because using an older version of Rouge" if Utils::Rouge.old_api?
+
+        assert_match(
+          %(
) + + %(
),
+          @result
+        )
+      end
+    end
+
     context "post content has highlight with file reference" do
       setup do
         fill_post("./jekyll.gemspec")