Skip to content

Commit a5d27b2

Browse files
committed
snippet
1 parent 6552dab commit a5d27b2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

liquid/tags/snippet.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,13 @@ func (s *SnippetTag) RenderToOutputBuffer(context liquid.TagContext, output *str
5555
snippetDrop := liquid.NewSnippetDrop(bodyOutput, s.to, templateName)
5656

5757
// Assign to variable in last scope (matching Ruby's context.scopes.last[@to])
58-
ctx.SetLast(s.to, snippetDrop)
58+
// Use direct scope access like the test does
59+
scopes := ctx.Scopes()
60+
if len(scopes) == 0 {
61+
scopes = []map[string]interface{}{make(map[string]interface{})}
62+
}
63+
// Set in the last scope
64+
scopes[len(scopes)-1][s.to] = snippetDrop
5965

6066
// Increment assign score in resource limits
6167
rl := context.ResourceLimits()

0 commit comments

Comments
 (0)