From 7458bca34b4179fc71bf1c5bbceb2ec0189dfc66 Mon Sep 17 00:00:00 2001
From: Holger Just <h.just@finn.de>
Date: Sat, 17 Dec 2011 22:10:53 +0100
Subject: [PATCH] Don't create arguments for legacy tags if there aren't any

---
 lib/chili_project/liquid/legacy.rb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/chili_project/liquid/legacy.rb b/lib/chili_project/liquid/legacy.rb
index ab92800b8..58cc06ff7 100644
--- a/lib/chili_project/liquid/legacy.rb
+++ b/lib/chili_project/liquid/legacy.rb
@@ -24,7 +24,8 @@ module ChiliProject
           next unless macro[:match].present? && macro[:replace].present?
           content = content.gsub(macro[:match]) do |match|
             # Use block form so $1 and $2 are set properly
-            "{#{macro[:replace]} #{macro[:new_name]} '#{$2}' #{macro[:replace]}}"
+            args = " '#{$2}'" if $2
+            "{#{macro[:replace]} #{macro[:new_name]}#{args} #{macro[:replace]}}"
           end
         end
         content
-- 
GitLab