From fe4c5566feb4c8022f98928b70f423f2ea2de617 Mon Sep 17 00:00:00 2001 From: Pat Hawks Date: Mon, 11 Jan 2016 13:50:15 -0800 Subject: [PATCH] Do not escape characters --- lib/jekyll-seo-tag.rb | 9 --------- spec/jekyll_seo_tag_spec.rb | 13 ------------- 2 files changed, 22 deletions(-) diff --git a/lib/jekyll-seo-tag.rb b/lib/jekyll-seo-tag.rb index 5fb9800..ed8c0d9 100644 --- a/lib/jekyll-seo-tag.rb +++ b/lib/jekyll-seo-tag.rb @@ -3,19 +3,10 @@ module Jekyll attr_accessor :context - HTML_ESCAPE = { - "\u201c".freeze => '“'.freeze, - "\u201d".freeze => '”'.freeze - } - HTML_ESCAPE_REGEX = Regexp.union(HTML_ESCAPE.keys).freeze - def render(context) @context = context output = Liquid::Template.parse(template_contents).render!(payload, info) - # Encode smart quotes. See https://github.com/benbalter/jekyll-seo-tag/pull/6 - output.gsub!(HTML_ESCAPE_REGEX, HTML_ESCAPE) - output end diff --git a/spec/jekyll_seo_tag_spec.rb b/spec/jekyll_seo_tag_spec.rb index 1bc8a04..0b47fac 100644 --- a/spec/jekyll_seo_tag_spec.rb +++ b/spec/jekyll_seo_tag_spec.rb @@ -32,19 +32,6 @@ describe Jekyll::SeoTag do expect(subject.render(context)).to match(/foo<\/title>/) end - it "escapes titles" do - site = site({"title" => 'Jekyll & "Hyde"'}) - context = context({ :site => site }) - expect(subject.render(context)).to match(/<title>Jekyll & “Hyde”<\/title>/) - end - - it "escapes descriptions" do - site = site({"description" => 'Jekyll & "Hyde"'}) - context = context({ :site => site }) - expected = /<meta name="description" content="Jekyll & “Hyde”" \/>/ - expect(subject.render(context)).to match(expected) - end - it "uses the page description" do page = page({"description" => "foo"}) context = context({ :page => page })