Skip to content

Commit b2a1d61

Browse files
committed
Swap out albino for pygments.rb
1 parent 7d88f72 commit b2a1d61

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

jekyll.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Gem::Specification.new do |s|
2727
s.add_runtime_dependency('directory_watcher', "~> 1.1")
2828
s.add_runtime_dependency('maruku', "~> 0.5")
2929
s.add_runtime_dependency('kramdown', "~> 0.13.4")
30-
s.add_runtime_dependency('albino', "~> 1.3")
30+
s.add_runtime_dependency('pygments.rb', "~> 0.2.12")
3131

3232
s.add_development_dependency('rake', "~> 0.9")
3333
s.add_development_dependency('rdoc', "~> 3.11")

lib/jekyll.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def require_all(path)
2424
# 3rd party
2525
require 'liquid'
2626
require 'maruku'
27-
require 'albino'
27+
require 'pygments'
2828

2929
# internal requires
3030
require 'jekyll/core_ext'

lib/jekyll/tags/highlight.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,13 @@ def render(context)
4848
end
4949

5050
def render_pygments(context, code)
51-
output = add_code_tags(Albino.new(code, @lang).to_s(@options), @lang)
51+
@options[:encoding] = 'utf-8'
52+
53+
output = add_code_tags(
54+
Pygments.highlight(code, :lexer => @lang, :options => @options),
55+
@lang
56+
)
57+
5258
output = context["pygments_prefix"] + output if context["pygments_prefix"]
5359
output = output + context["pygments_suffix"] if context["pygments_suffix"]
5460
output

0 commit comments

Comments
 (0)