Skip to content

Commit 9f53718

Browse files
committed
Merge pull request #21 from benbalter/entities
Do not escape smart quotes
2 parents 5c3d234 + fe4c556 commit 9f53718

File tree

2 files changed

+0
-22
lines changed

2 files changed

+0
-22
lines changed

lib/jekyll-seo-tag.rb

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,10 @@ class SeoTag < Liquid::Tag
33

44
attr_accessor :context
55

6-
HTML_ESCAPE = {
7-
"\u201c".freeze => '&ldquo;'.freeze,
8-
"\u201d".freeze => '&rdquo;'.freeze
9-
}
10-
HTML_ESCAPE_REGEX = Regexp.union(HTML_ESCAPE.keys).freeze
11-
126
def render(context)
137
@context = context
148
output = template.render!(payload, info)
159

16-
# Encode smart quotes. See https://github.com/benbalter/jekyll-seo-tag/pull/6
17-
output.gsub!(HTML_ESCAPE_REGEX, HTML_ESCAPE)
18-
1910
output
2011
end
2112

spec/jekyll_seo_tag_spec.rb

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,6 @@
3232
expect(subject.render(context)).to match(/<title>foo<\/title>/)
3333
end
3434

35-
it "escapes titles" do
36-
site = site({"title" => 'Jekyll & "Hyde"'})
37-
context = context({ :site => site })
38-
expect(subject.render(context)).to match(/<title>Jekyll &amp; &ldquo;Hyde&rdquo;<\/title>/)
39-
end
40-
41-
it "escapes descriptions" do
42-
site = site({"description" => 'Jekyll & "Hyde"'})
43-
context = context({ :site => site })
44-
expected = /<meta name="description" content="Jekyll &amp; &ldquo;Hyde&rdquo;" \/>/
45-
expect(subject.render(context)).to match(expected)
46-
end
47-
4835
it "uses the page description" do
4936
page = page({"description" => "foo"})
5037
context = context({ :page => page })

0 commit comments

Comments
 (0)