Skip to content

Commit

Permalink
render nil tags as {{tag_name}} instead of {{ tag_name }}
Browse files Browse the repository at this point in the history
  • Loading branch information
dave farkas committed Feb 26, 2011
1 parent 19dd21b commit 8a4048d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/liquid/block.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def render_all(list, context)
begin
if token.respond_to?(:render)
r = token.render(context)
r.nil? && leave_missing_tags ? "{{ #{token.name} }}" : r
r.nil? && leave_missing_tags ? "{{#{token.name}}}" : r
else
token
end
Expand Down
2 changes: 1 addition & 1 deletion test/lib/liquid/template_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def test_lambda_is_called_once_from_custom_assigns_over_multiple_parses_and_rend

def test_leave_missing_tags
template = Liquid::Template.parse( ' {{ first_name }}, {{ foo }} ' ).leave_missing_tags
assert_equal " {{ first_name }}, bar ", template.render('foo' => "bar")
assert_equal " {{first_name}}, bar ", template.render('foo' => "bar")
end

end # TemplateTest

0 comments on commit 8a4048d

Please sign in to comment.