We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 63a6ef7 commit 87b93edCopy full SHA for 87b93ed
lib/jekyll-gist/gist_tag.rb
@@ -54,7 +54,13 @@ def gist_noscript_tag(gist_id, filename = nil)
54
code = fetch_raw_code(gist_id, filename)
55
if !code.nil?
56
code = code.force_encoding(@encoding)
57
- "<noscript><pre>#{CGI.escapeHTML(code)}</pre></noscript>"
+ code = CGI.escapeHTML(code)
58
+
59
+ # CGI.escapeHTML behavior differs in Ruby < 2.0
60
+ # See https://github.com/jekyll/jekyll-gist/pull/28
61
+ code = code.gsub("'", "'") if RUBY_VERSION < "2.0"
62
63
+ "<noscript><pre>#{code}</pre></noscript>"
64
else
65
Jekyll.logger.warn "Warning:", "The <noscript> tag for your gist #{gist_id} could not"
66
Jekyll.logger.warn "", "be generated. This will affect users who do not have"
0 commit comments