From 976bfe7a5c5191bb33d8592063e37b68881ae090 Mon Sep 17 00:00:00 2001 From: Yusuke NISHIOKA Date: Tue, 18 May 2021 21:17:24 +0900 Subject: [PATCH] Fix bug that the domain link is broken --- lib/jekyll-linkpreview.rb | 2 +- spec/jekyll-linkpreview_spec.rb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/jekyll-linkpreview.rb b/lib/jekyll-linkpreview.rb index 508e211..a7e3b66 100644 --- a/lib/jekyll-linkpreview.rb +++ b/lib/jekyll-linkpreview.rb @@ -254,7 +254,7 @@ def gen_default_template(hash) diff --git a/spec/jekyll-linkpreview_spec.rb b/spec/jekyll-linkpreview_spec.rb index 505d1ed..af7b98c 100644 --- a/spec/jekyll-linkpreview_spec.rb +++ b/spec/jekyll-linkpreview_spec.rb @@ -544,6 +544,7 @@ def check_default_template_with_image_is_rendered(html) expect(doc.xpath('//h2[@class="jekyll-linkpreview-title"]/a').inner_text).to eq @title expect(doc.xpath('//h2[@class="jekyll-linkpreview-title"]/a').attribute('href').value).to eq @url expect(doc.xpath('//div[@class="jekyll-linkpreview-footer"]/a').inner_text).to eq @domain + expect(doc.xpath('//div[@class="jekyll-linkpreview-footer"]/a').attribute('href').value).to eq "//#{@domain}" expect(doc.xpath('//div[@class="jekyll-linkpreview-image"]/a/img').attribute('src').value).to eq @image expect(doc.xpath('//div[@class="jekyll-linkpreview-description"]').inner_text).to eq @description end @@ -553,6 +554,7 @@ def check_default_template_without_image_is_rendered(html) expect(doc.xpath('//h2[@class="jekyll-linkpreview-title"]/a').inner_text).to eq @title expect(doc.xpath('//h2[@class="jekyll-linkpreview-title"]/a').attribute('href').value).to eq @url expect(doc.xpath('//div[@class="jekyll-linkpreview-footer"]/a').inner_text).to eq @domain + expect(doc.xpath('//div[@class="jekyll-linkpreview-footer"]/a').attribute('href').value).to eq "//#{@domain}" expect(doc.xpath('//div[@class="jekyll-linkpreview-image"]')).to be_empty expect(doc.xpath('//div[@class="jekyll-linkpreview-description"]').inner_text).to eq @description end