mirror of
https://github.com/jekyll/jekyll.git
synced 2026-04-06 03:01:43 -04:00
Drop support for older versions of Rouge (#6978)
Merge pull request 6978
This commit is contained in:
@@ -57,7 +57,8 @@ class Jekyll::Converters::Markdown::RedcarpetParser
|
||||
|
||||
protected
|
||||
def rouge_formatter(_lexer)
|
||||
Jekyll::Utils::Rouge.html_formatter(:wrap => false)
|
||||
require "rouge"
|
||||
::Rouge::Formatters::HTMLLegacy.new(:wrap => false)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -112,7 +112,8 @@ MSG
|
||||
end
|
||||
|
||||
def render_rouge(code)
|
||||
formatter = Jekyll::Utils::Rouge.html_formatter(
|
||||
require "rouge"
|
||||
formatter = ::Rouge::Formatters::HTMLLegacy.new(
|
||||
:line_numbers => @highlight_options[:linenos],
|
||||
:wrap => false,
|
||||
:css_class => "highlight",
|
||||
|
||||
@@ -7,7 +7,6 @@ module Jekyll
|
||||
autoload :Exec, "jekyll/utils/exec"
|
||||
autoload :Internet, "jekyll/utils/internet"
|
||||
autoload :Platforms, "jekyll/utils/platforms"
|
||||
autoload :Rouge, "jekyll/utils/rouge"
|
||||
autoload :ThreadEvent, "jekyll/utils/thread_event"
|
||||
autoload :WinTZ, "jekyll/utils/win_tz"
|
||||
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
Jekyll::External.require_with_graceful_fail("rouge")
|
||||
|
||||
module Jekyll
|
||||
module Utils
|
||||
module Rouge
|
||||
|
||||
def self.html_formatter(*args)
|
||||
if old_api?
|
||||
::Rouge::Formatters::HTML.new(*args)
|
||||
else
|
||||
::Rouge::Formatters::HTMLLegacy.new(*args)
|
||||
end
|
||||
end
|
||||
|
||||
def self.old_api?
|
||||
::Rouge.version.to_s < "2"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user