Don't create arguments for legacy tags if there aren't any

This commit is contained in:
Holger Just 2011-12-17 22:10:53 +01:00
parent 60deeb5306
commit 7458bca34b
1 changed files with 2 additions and 1 deletions

View File

@ -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