Skip to content

Commit 9a8bc53

Browse files
committed
Merge pull request #23 from akerl/utf8-fix
Merge pull request 23
2 parents 2b8ecd2 + 093a47b commit 9a8bc53

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/jekyll-gist/gist_tag.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ module Gist
99
class GistTag < Liquid::Tag
1010

1111
def render(context)
12+
@encoding = context.registers[:site].config['encoding'] || 'utf-8'
1213
if tag_contents = determine_arguments(@markup.strip)
1314
gist_id, filename = tag_contents[0], tag_contents[1]
1415
if context.has_key?(gist_id)
@@ -51,6 +52,7 @@ def gist_script_tag(gist_id, filename = nil)
5152
def gist_noscript_tag(gist_id, filename = nil)
5253
code = fetch_raw_code(gist_id, filename)
5354
if !code.nil?
55+
code = code.force_encoding(@encoding)
5456
"<noscript><pre>#{CGI.escapeHTML(code)}</pre></noscript>"
5557
else
5658
Jekyll.logger.warn "Warning:", "The <noscript> tag for your gist #{gist_id} could not"

0 commit comments

Comments
 (0)