mirror of
https://github.com/jekyll/jekyll.git
synced 2026-02-08 05:35:00 -05:00
Merge branch 'switch-to-pygmentsrb' of https://github.com/tombell/jekyll into tombell-switch-to-pygmentsrb
This commit is contained in:
@@ -24,7 +24,7 @@ require 'English'
|
||||
# 3rd party
|
||||
require 'liquid'
|
||||
require 'maruku'
|
||||
require 'albino'
|
||||
require 'pygments'
|
||||
|
||||
# internal requires
|
||||
require 'jekyll/core_ext'
|
||||
|
||||
@@ -48,7 +48,13 @@ module Jekyll
|
||||
end
|
||||
|
||||
def render_pygments(context, code)
|
||||
output = add_code_tags(Albino.new(code, @lang).to_s(@options), @lang)
|
||||
@options[:encoding] = 'utf-8'
|
||||
|
||||
output = add_code_tags(
|
||||
Pygments.highlight(code, :lexer => @lang, :options => @options),
|
||||
@lang
|
||||
)
|
||||
|
||||
output = context["pygments_prefix"] + output if context["pygments_prefix"]
|
||||
output = output + context["pygments_suffix"] if context["pygments_suffix"]
|
||||
output
|
||||
|
||||
Reference in New Issue
Block a user