diff --git a/features/collections.feature b/features/collections.feature index dc4ea311..d97918bd 100644 --- a/features/collections.feature +++ b/features/collections.feature @@ -9,7 +9,7 @@ Feature: Collections And I have a configuration file with "collections" set to "['methods']" When I run jekyll build Then the _site directory should exist - And I should see "Collections:

Use Jekyll.configuration to build a full configuration for use w/Jekyll.

\n\n

Whatever: foo.bar

\n

Signs are nice

\n

Jekyll.sanitized_path is used to make sure your path is in your source.

\n

Run your generators! default

\n

Page without title.

\n

Run your generators! default

" in "_site/index.html" + And I should see "Collections:

Use Jekyll.configuration to build a full configuration for use w/Jekyll.

\n\n

Whatever: foo.bar

\n

Signs are nice

\n

Jekyll.sanitized_path is used to make sure your path is in your source.

\n

Run your generators! default

\n

Page without title.

\n

Run your generators! default

" in "_site/index.html" And the "_site/methods/configuration.html" file should not exist Scenario: Rendered collection @@ -108,7 +108,7 @@ Feature: Collections """ When I run jekyll build Then the _site directory should exist - And I should see "First document's output:

Use Jekyll.configuration to build a full configuration for use w/Jekyll.

\n\n

Whatever: foo.bar

" in "_site/index.html" + And I should see "First document's output:

Use Jekyll.configuration to build a full configuration for use w/Jekyll.

\n\n

Whatever: foo.bar

" in "_site/index.html" Scenario: Filter documents by where Given I have an "index.html" page that contains "{% assign items = site.methods | where: 'whatever','foo.bar' %}Item count: {{ items.size }}" diff --git a/lib/jekyll/converters/markdown/kramdown_parser.rb b/lib/jekyll/converters/markdown/kramdown_parser.rb index a9dbec96..40dfa87e 100644 --- a/lib/jekyll/converters/markdown/kramdown_parser.rb +++ b/lib/jekyll/converters/markdown/kramdown_parser.rb @@ -5,6 +5,11 @@ module Jekyll def initialize(config) require 'kramdown' @config = config + # If kramdown supported highlighter enabled, use that + highlighter = @config['highlighter'] + if highlighter == 'rouge' || highlighter == 'coderay' + @config['kramdown']['syntax_highlighter'] ||= highlighter + end rescue LoadError STDERR.puts 'You are missing a library required for Markdown. Please run:' STDERR.puts ' $ [sudo] gem install kramdown' diff --git a/test/test_kramdown.rb b/test/test_kramdown.rb index 7101baaa..b7f44925 100644 --- a/test/test_kramdown.rb +++ b/test/test_kramdown.rb @@ -39,6 +39,16 @@ class TestKramdown < JekyllUnitTest assert_match /

(«|«)Pit(›|›)hy(»|»)<\/p>/, markdown.convert(%{"Pit'hy"}).strip end + should "render fenced code blocks with syntax highlighting" do + assert_equal "

puts \"Hello world\"\n
\n
", @markdown.convert( + <<-EOS +~~~ruby +puts "Hello world" +~~~ + EOS + ).strip + end + context "moving up nested coderay options" do setup do @markdown.convert('some markup')