Skip to content

liquid for attribute should be reversed, not reverse #14

Description

@osteele

See the Liquid documentation https://help.shopify.com/themes/liquid/tags/iteration-tags#for (search for reversed), and the Shopify/liquid test:

    assert_template_result('321', '{%for item in array reversed %}{{item}}{%endfor%}', assigns)

To reproduce:

	template, err := liquid.ParseString("{% for item in array reversed %}{{item}}{% endfor%}", nil)
	if err != nil {
		fmt.Println("err:", err)
	} else {
		writer := new(bytes.Buffer)
		template.Render(writer, map[string]interface{}{
			"array": []int{1, 2, 3},
		})
		fmt.Println(writer)
	}

Expected:
321

Actual (once #13 is fixed):
err: "reversed" is an unknown attribute in for tag ("{% for item in array reverse %}" - line 1)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions