{"action":"created","issue":{"url":"https://api.github.com/repos/harttle/liquidjs/issues/63","repository_url":"https://api.github.com/repos/harttle/liquidjs","labels_url":"https://api.github.com/repos/harttle/liquidjs/issues/63/labels{/name}","comments_url":"https://api.github.com/repos/harttle/liquidjs/issues/63/comments","events_url":"https://api.github.com/repos/harttle/liquidjs/issues/63/events","html_url":"https://github.com/harttle/liquidjs/issues/63","id":306200725,"number":63,"title":"Filter, parse object arguments bug","user":{"login":"cmawhorter","id":142338,"avatar_url":"https://avatars2.githubusercontent.com/u/142338?v=4","gravatar_id":"","url":"https://api.github.com/users/cmawhorter","html_url":"https://github.com/cmawhorter","followers_url":"https://api.github.com/users/cmawhorter/followers","following_url":"https://api.github.com/users/cmawhorter/following{/other_user}","gists_url":"https://api.github.com/users/cmawhorter/gists{/gist_id}","starred_url":"https://api.github.com/users/cmawhorter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmawhorter/subscriptions","organizations_url":"https://api.github.com/users/cmawhorter/orgs","repos_url":"https://api.github.com/users/cmawhorter/repos","events_url":"https://api.github.com/users/cmawhorter/events{/privacy}","received_events_url":"https://api.github.com/users/cmawhorter/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-18T00:00:17Z","updated_at":"2018-03-19T03:33:37Z","closed_at":null,"author_association":"NONE","body":"There is a bug in the way object filter arguments are parsed when the key is named the same as the value.\r\n\r\nExample: `foo: someval: someval` with context `{ someval: 'hello' }`\r\n\r\nThat should result in args that are `[ 'someval', 'hello' ]` but instead it results in `[ 'someval', 'someval' ]`\r\n\r\nHere's a runkit that shows this: https://runkit.com/embed/auys4zba1gxn\r\n\r\nI have it fixed in my fork.  That also includes tests, but I can't PR because I've made a ton of breaking changes.\r\n\r\nhttps://github.com/stampr/liquidjs/blob/f24c8c49b66890b1c7ca6d332edfa082d9398a42/src/filter.js#L36-L43\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/harttle/liquidjs/issues/comments/374091676","html_url":"https://github.com/harttle/liquidjs/issues/63#issuecomment-374091676","issue_url":"https://api.github.com/repos/harttle/liquidjs/issues/63","id":374091676,"user":{"login":"harttle","id":4427974,"avatar_url":"https://avatars3.githubusercontent.com/u/4427974?v=4","gravatar_id":"","url":"https://api.github.com/users/harttle","html_url":"https://github.com/harttle","followers_url":"https://api.github.com/users/harttle/followers","following_url":"https://api.github.com/users/harttle/following{/other_user}","gists_url":"https://api.github.com/users/harttle/gists{/gist_id}","starred_url":"https://api.github.com/users/harttle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harttle/subscriptions","organizations_url":"https://api.github.com/users/harttle/orgs","repos_url":"https://api.github.com/users/harttle/repos","events_url":"https://api.github.com/users/harttle/events{/privacy}","received_events_url":"https://api.github.com/users/harttle/received_events","type":"User","site_admin":false},"created_at":"2018-03-19T03:33:37Z","updated_at":"2018-03-19T03:33:37Z","author_association":"OWNER","body":"Seems a misunderstanding to the render process. When invoked with a template string and the corresponding context, the liquid engine:\r\n\r\n1. parses the string into template objects, consisting of tokens with their hierarchy. This is done by the parser and there's no concept of context at this stage.\r\n2. renders the template objects with a given context, just like populating values into a format string.\r\n\r\nFor you case:\r\n\r\n* The syntax `foo: someval: someval` is not correct. Arguments for a filter should be separated by `,` (comma). For example: https://shopify.github.io/liquid/filters/replace_first/\r\n* The parsed arguments `['someval', 'someval']` can be further rendered to `['someval', 'hello']` if you call the render on it: https://github.com/harttle/liquidjs/blob/master/src/filter.js#L13\r\n\r\nGenerally, you'll not want to do that manually, just register a filter and the above process is ready to run. See: https://github.com/harttle/liquidjs#register-filters"}}
{"actor":{"display_login":"harttle"}}