Merge pull request #228 from jekyll/fix-for-invalid-url

Fix for image.path causing an invalid url error
This commit is contained in:
Ben Balter 2017-08-22 13:02:26 -04:00 committed by GitHub
commit ba3b326513
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