{"action":"created","issue":{"url":"https://api.github.com/repos/wycats/handlebars.js/issues/979","labels_url":"https://api.github.com/repos/wycats/handlebars.js/issues/979/labels{/name}","comments_url":"https://api.github.com/repos/wycats/handlebars.js/issues/979/comments","events_url":"https://api.github.com/repos/wycats/handlebars.js/issues/979/events","html_url":"https://github.com/wycats/handlebars.js/issues/979","id":60877421,"number":979,"title":"Parent context reference behaves strangely","user":{"login":"difosfor","id":1737113,"avatar_url":"https://avatars.githubusercontent.com/u/1737113?v=3","gravatar_id":"","url":"https://api.github.com/users/difosfor","html_url":"https://github.com/difosfor","followers_url":"https://api.github.com/users/difosfor/followers","following_url":"https://api.github.com/users/difosfor/following{/other_user}","gists_url":"https://api.github.com/users/difosfor/gists{/gist_id}","starred_url":"https://api.github.com/users/difosfor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/difosfor/subscriptions","organizations_url":"https://api.github.com/users/difosfor/orgs","repos_url":"https://api.github.com/users/difosfor/repos","events_url":"https://api.github.com/users/difosfor/events{/privacy}","received_events_url":"https://api.github.com/users/difosfor/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-12T19:01:04Z","updated_at":"2015-03-13T04:24:42Z","closed_at":"2015-03-13T04:24:42Z","body":"In the following example, ../ seems to be equal to . so I have to use ../../ to get to the parent context. E.g: I would expect Y to work instead of Z.\r\n\r\nIt seems that adding a block helper like {{#if}} also adds another parent context level, even when the block context is equal to the parent context.\r\n\r\nIs this intended behavior or a bug?\r\n\r\nHTML:\r\n```html\r\n<script id=\"template\" type=\"text/template\">\r\n\t{{#each questions}}\r\n\t<div>\r\n\t\t{{#each answers}}\r\n\t\t<div>X: {{../id}}:{{code}}</div>\r\n\t\t{{#if @root.ready}}\r\n\t\t<div>Y: {{../id}}:{{code}}</div>\r\n\t\t<div>Z: {{../../id}}:{{code}}</div>\r\n\t\t{{/if}}\r\n\t\t{{/each}}\r\n\t</div>\r\n\t{{/each}}\r\n</script>\r\n```\r\n\r\nJavaScript:\r\n```javascript\r\nvar template = document.getElementById('template').innerHTML;\r\nvar compiled = Handlebars.compile(template);\r\nvar data = {\r\n\tready: true,\r\n\tquestions: [ {\r\n\t\tid: 1,\r\n\t\tanswers: [ { code: 'a' } ]\r\n\t} ]\r\n};\r\nvar html = compiled(data);\r\ndocument.body.innerHTML = html;\r\n```\r\n\r\n\r\nOutput:\r\n```html\r\nX: 1.a\r\nY: .a\r\nZ: 1.a\r\n```\r\n\r\nFiddle: http://jsfiddle.net/peterpaul/yd574m6n/\r\n"},"comment":{"url":"https://api.github.com/repos/wycats/handlebars.js/issues/comments/78792478","html_url":"https://github.com/wycats/handlebars.js/issues/979#issuecomment-78792478","issue_url":"https://api.github.com/repos/wycats/handlebars.js/issues/979","id":78792478,"user":{"login":"kpdecker","id":196390,"avatar_url":"https://avatars.githubusercontent.com/u/196390?v=3","gravatar_id":"","url":"https://api.github.com/users/kpdecker","html_url":"https://github.com/kpdecker","followers_url":"https://api.github.com/users/kpdecker/followers","following_url":"https://api.github.com/users/kpdecker/following{/other_user}","gists_url":"https://api.github.com/users/kpdecker/gists{/gist_id}","starred_url":"https://api.github.com/users/kpdecker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kpdecker/subscriptions","organizations_url":"https://api.github.com/users/kpdecker/orgs","repos_url":"https://api.github.com/users/kpdecker/repos","events_url":"https://api.github.com/users/kpdecker/events{/privacy}","received_events_url":"https://api.github.com/users/kpdecker/received_events","type":"User","site_admin":false},"created_at":"2015-03-13T04:24:42Z","updated_at":"2015-03-13T04:24:42Z","body":"This is the intended behavior."}}