fix for image.path causing an invalid url error

This commit is contained in:
Ben Balter 2017-08-22 11:53:18 -04:00
parent 351b04265a
commit 7cab0247ed
No known key found for this signature in database
GPG Key ID: DBB67C246AD356C4
2 changed files with 3 additions and 2 deletions

View File

@ -168,7 +168,8 @@ module Jekyll
image["path"] ||= image["facebook"] || image["twitter"]
return @image = nil unless image["path"]
unless absolute_url? image["path"]
# absolute_url? will return nil for an invalid URL
if absolute_url?(image["path"]) == false
image["path"] = filters.absolute_url image["path"]
end

View File

@ -563,7 +563,7 @@ RSpec.describe Jekyll::SeoTag::Drop do
let(:image) { ":" }
it "returns nil" do
expect(subject.image["path"]).to eql("/:")
expect(subject.image["path"]).to eql(":")
end
end