From 1ff084fe35c8c8f68732065407a1a93d70d585af Mon Sep 17 00:00:00 2001 From: Max Kleucker Date: Sat, 13 Feb 2016 20:19:42 +0100 Subject: [PATCH 1/2] Changed access to the extension of an item, so Jekyll doesn't emit deprecation-warnings anymore --- lib/octopress-codefence.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/octopress-codefence.rb b/lib/octopress-codefence.rb index 2a8e814..c7bbd65 100644 --- a/lib/octopress-codefence.rb +++ b/lib/octopress-codefence.rb @@ -5,7 +5,7 @@ module Octopress module Codefence Jekyll::Hooks.register [:posts, :pages, :documents], :pre_render do |item, payload| if item.respond_to?(:ext) - ext = item.ext + ext = item.data['ext'] else ext = nil end From 2f0a0f0de180e41623ef5028e88f8eae5e1da502 Mon Sep 17 00:00:00 2001 From: Tony Duckles Date: Thu, 25 Jan 2018 20:27:04 -0600 Subject: [PATCH 2/2] Fix Jekyll compatibility: lib/octopress-codefence.rb:26:in `encode!': can't modify frozen String (RuntimeError) --- lib/octopress-codefence.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/octopress-codefence.rb b/lib/octopress-codefence.rb index c7bbd65..21ecdf8 100644 --- a/lib/octopress-codefence.rb +++ b/lib/octopress-codefence.rb @@ -17,7 +17,7 @@ class Highlighter LangCaption = /([^\s]+)\s*(.+)?/i def initialize(input, ext=nil, aliases=nil) - @input = input + @input = input.dup @ext = ext @aliases = aliases end