Merge pull request #1397 from nfagerlund/error_187_undefined_method_encoding_for_mailto
Fix 'undefined method `encoding` for "mailto"' errors w/ Ruby 1.8 and Kramdown > 0.14.0
This commit is contained in:
commit
3703bde3b1
|
@ -24,7 +24,9 @@ module Jekyll
|
||||||
private
|
private
|
||||||
def replace_generated_toc(rd, html, toc_token)
|
def replace_generated_toc(rd, html, toc_token)
|
||||||
if rd.generate_toc && html.include?(toc_token)
|
if rd.generate_toc && html.include?(toc_token)
|
||||||
html.gsub(toc_token, rd.toc_content.force_encoding('utf-8'))
|
utf8_toc = rd.toc_content
|
||||||
|
utf8_toc.force_encoding('utf-8') if utf8_toc.respond_to?(:force_encoding)
|
||||||
|
html.gsub(toc_token, utf8_toc)
|
||||||
else
|
else
|
||||||
html
|
html
|
||||||
end
|
end
|
||||||
|
|
|
@ -69,11 +69,3 @@ module Enumerable
|
||||||
any? { |exp| File.fnmatch?(exp, e) }
|
any? { |exp| File.fnmatch?(exp, e) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if RUBY_VERSION < "1.9"
|
|
||||||
class String
|
|
||||||
def force_encoding(enc)
|
|
||||||
self
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
Loading…
Reference in New Issue