We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c29c923 + b6f0963 commit c4bac39Copy full SHA for c4bac39
lib/jekyll-seo-tag.rb
@@ -3,6 +3,12 @@ class SeoTag < Liquid::Tag
3
4
attr_accessor :context
5
6
+ HTML_ESCAPE = {
7
+ "\u201c".freeze => '“'.freeze,
8
+ "\u201d".freeze => '”'.freeze
9
+ }
10
+ HTML_ESCAPE_REGEX = Regexp.union(HTML_ESCAPE.keys).freeze
11
+
12
def render(context)
13
@context = context
14
output = Liquid::Template.parse(template_contents).render!(payload, info)
@@ -11,8 +17,7 @@ def render(context)
17
output.gsub!(/[\s]{2,}/, "\n")
18
19
# Encode smart quotes. See https://github.com/benbalter/jekyll-seo-tag/pull/6
- output.gsub!("\u201c", "“")
15
- output.gsub!("\u201d", "”")
20
+ output.gsub!(HTML_ESCAPE_REGEX, HTML_ESCAPE)
16
21
22
output
23
end
0 commit comments