1+ # frozen_string_literal: true
2+
13require "cgi"
24require "net/http"
35require "octokit"
@@ -11,7 +13,7 @@ class GistTag < Liquid::Tag
1113 def render ( context )
1214 @encoding = context . registers [ :site ] . config [ "encoding" ] || "utf-8"
1315 @settings = context . registers [ :site ] . config [ "gist" ]
14- if tag_contents = determine_arguments ( @markup . strip )
16+ if ( tag_contents = determine_arguments ( @markup . strip ) )
1517 gist_id = tag_contents [ 0 ]
1618 filename = tag_contents [ 1 ]
1719 if context_contains_key? ( context , gist_id )
@@ -24,7 +26,7 @@ def render(context)
2426 script_tag = gist_script_tag ( gist_id , filename )
2527 "#{ noscript_tag } #{ script_tag } "
2628 else
27- raise ArgumentError , <<-eos
29+ raise ArgumentError , <<-EOS
2830 Syntax error in tag 'gist' while parsing the following markup:
2931
3032 #{ @markup }
@@ -34,7 +36,7 @@ def render(context)
3436 {% gist user/1234567 foo.js %}
3537 {% gist 28949e1d5ee2273f9fd3 %}
3638 {% gist 28949e1d5ee2273f9fd3 best.md %}
37- eos
39+ EOS
3840 end
3941 end
4042
@@ -74,9 +76,9 @@ def gist_noscript_tag(gist_id, filename = nil)
7476
7577 "<noscript><pre>#{ code } </pre></noscript>"
7678 else
77- Jekyll . logger . warn "Warning:" , "The <noscript> tag for your gist #{ gist_id } could not "
78- Jekyll . logger . warn "" , "be generated. This will affect users who do not have "
79- Jekyll . logger . warn "" , "JavaScript available or enabled in their browsers."
79+ Jekyll . logger . warn "Warning:" , "The <noscript> tag for your gist #{ gist_id } "
80+ Jekyll . logger . warn "" , "could not be generated. This will affect users who do "
81+ Jekyll . logger . warn "" , "not have JavaScript enabled in their browsers."
8082 end
8183 end
8284
0 commit comments