Allow no last space for gist number only in gist tag

Closes #1394
This commit is contained in:
rcmdnk 2013-11-17 22:47:06 -05:00 committed by Parker Moore
parent abc9ef5113
commit 7f26224bb8

View File

@ -23,11 +23,15 @@ module Jekyll
def render(context)
if parts = @text.match(/([a-zA-Z\d]*) (.*)/)
gist, file = parts[1].strip, parts[2].strip
else
gist, file = @text.strip, ""
end
if gist.empty?
""
else
script_url = script_url_for gist, file
code = get_cached_gist(gist, file) || get_gist_from_web(gist, file)
html_output_for script_url, code
else
""
end
end