From 5d636129ba8591004be2abf4a98297a8aa0e2152 Mon Sep 17 00:00:00 2001 From: Atsushi Nagase Date: Sun, 31 May 2020 12:24:13 +0900 Subject: [PATCH] Fix escaping --- lib/middleman-ogp/extension.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/middleman-ogp/extension.rb b/lib/middleman-ogp/extension.rb index 3258205..9a9ff76 100644 --- a/lib/middleman-ogp/extension.rb +++ b/lib/middleman-ogp/extension.rb @@ -87,7 +87,7 @@ def ogp_tags(&block) # rubocop:disable all end if Middleman::OGP::Helper.auto.include?('url') && Middleman::OGP::Helper.base_url - opts[:og][:url] = URI.join(Middleman::OGP::Helper.base_url, URI.encode_www_form(current_resource.url)) + opts[:og][:url] = URI.join(Middleman::OGP::Helper.base_url, current_resource.url) end Middleman::OGP::Helper.ogp_tags(opts) do |name, value| @@ -162,7 +162,7 @@ def self.og_tag(key, obj = nil, prefix = 'og', &block) # rubocop:disable Metrics name = [prefix].concat(key).join(':') value = obj.to_s if Middleman::OGP::Helper.image_base_url && name == 'og:image' && !%r{^https?://}.match(value) - value = URI.join(Middleman::OGP::Helper.image_base_url, URI.encode_www_form(value)) + value = URI.join(Middleman::OGP::Helper.image_base_url, value) end block.call name, value end