From 7a55460f2c44c1c9781ed7de39a66310e87c97cf Mon Sep 17 00:00:00 2001 From: Pat Hawks Date: Wed, 6 Jan 2016 12:29:14 -0800 Subject: [PATCH] Minify template just once --- lib/jekyll-seo-tag.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/jekyll-seo-tag.rb b/lib/jekyll-seo-tag.rb index 7fa0d32..5fb9800 100644 --- a/lib/jekyll-seo-tag.rb +++ b/lib/jekyll-seo-tag.rb @@ -13,9 +13,6 @@ module Jekyll @context = context output = Liquid::Template.parse(template_contents).render!(payload, info) - # Minify - output.gsub!(/[\s]{2,}/, "\n") - # Encode smart quotes. See https://github.com/benbalter/jekyll-seo-tag/pull/6 output.gsub!(HTML_ESCAPE_REGEX, HTML_ESCAPE) @@ -39,7 +36,7 @@ module Jekyll end def template_contents - @template_contents ||= File.read(template_path) + @template_contents ||= File.read(template_path).gsub(/(>\n|[%}]})\s+(<|{[{%])/,'\1\2').chomp end def template_path