diff --git a/README.md b/README.md
index d606a7c..cd39080 100644
--- a/README.md
+++ b/README.md
@@ -47,6 +47,8 @@ You may optionally specify a `filename` after the `gist_id`:
This will produce the correct URL to show just the specified file in your post rather than the entire Gist.
+**Pro-tip**: If you provide a personal access token with Gist scope, as the environmental variable `JEKYLL_GITHUB_TOKEN`, Jekyll Gist will use the Gist API to speed up site generation.
+
## Disabling `noscript` support
By default, Jekyll Gist will make an HTTP call per Gist to retrieve the raw content of the Gist. This information is used to propagate `noscript` tags for search engines and browsers without Javascript support. If you'd like to disable this feature, for example, to speed up builds locally, simply add the following to your site's `_config.yml`:
diff --git a/jekyll-gist.gemspec b/jekyll-gist.gemspec
index b4f3ece..8b62a2a 100644
--- a/jekyll-gist.gemspec
+++ b/jekyll-gist.gemspec
@@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]
+ spec.add_dependency "octokit", "~> 4.2"
spec.add_development_dependency "bundler", "~> 1.6"
spec.add_development_dependency "rake"
spec.add_development_dependency "rspec"
diff --git a/lib/jekyll-gist/gist_tag.rb b/lib/jekyll-gist/gist_tag.rb
index 86bafac..83a1595 100644
--- a/lib/jekyll-gist/gist_tag.rb
+++ b/lib/jekyll-gist/gist_tag.rb
@@ -1,5 +1,6 @@
require 'cgi'
require 'net/http'
+require 'octokit'
Net::OpenTimeout = Class.new(RuntimeError) unless Net.const_defined?(:OpenTimeout)
Net::ReadTimeout = Class.new(RuntimeError) unless Net.const_defined?(:ReadTimeout)
@@ -55,7 +56,13 @@ def gist_noscript_tag(gist_id, filename = nil)
code = fetch_raw_code(gist_id, filename)
if !code.nil?
code = code.force_encoding(@encoding)
- ""
+ code = CGI.escapeHTML(code)
+
+ # CGI.escapeHTML behavior differs in Ruby < 2.0
+ # See https://github.com/jekyll/jekyll-gist/pull/28
+ code = code.gsub("'", "'") if RUBY_VERSION < "2.0"
+
+ ""
else
Jekyll.logger.warn "Warning:", "The