{"action":"closed","issue":{"url":"https://api.github.com/repos/ecomfe/etpl/issues/57","labels_url":"https://api.github.com/repos/ecomfe/etpl/issues/57/labels{/name}","comments_url":"https://api.github.com/repos/ecomfe/etpl/issues/57/comments","events_url":"https://api.github.com/repos/ecomfe/etpl/issues/57/events","html_url":"https://github.com/ecomfe/etpl/issues/57","id":81703786,"number":57,"title":"import嵌套时，有bug","user":{"login":"errorrik","id":2851010,"avatar_url":"https://avatars.githubusercontent.com/u/2851010?v=3","gravatar_id":"","url":"https://api.github.com/users/errorrik","html_url":"https://github.com/errorrik","followers_url":"https://api.github.com/users/errorrik/followers","following_url":"https://api.github.com/users/errorrik/following{/other_user}","gists_url":"https://api.github.com/users/errorrik/gists{/gist_id}","starred_url":"https://api.github.com/users/errorrik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/errorrik/subscriptions","organizations_url":"https://api.github.com/users/errorrik/orgs","repos_url":"https://api.github.com/users/errorrik/repos","events_url":"https://api.github.com/users/errorrik/events{/privacy}","received_events_url":"https://api.github.com/users/errorrik/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-28T01:32:24Z","updated_at":"2015-05-28T01:33:12Z","closed_at":"2015-05-28T01:33:12Z","body":"@otakustay 发现的问题\r\n\r\n```html\r\n<!-- import: listPage -->\r\n    <!-- block: crumb --><!-- import: exampleListCrumb --><!-- /block -->\r\n    <!-- block: main -->World<!-- /block -->\r\n<!-- /import -->\r\n\r\n<!-- target: exampleListCrumb -->\r\n<!-- import: crumb -->\r\n    <!-- block: path -->\r\n        <span>示例</span>\r\n    <!-- /block -->\r\n<!-- /import -->\r\n\r\n<!-- target: listPage -->\r\n<div class=\"list-page\">\r\n    <div class=\"page-crumb\">\r\n        <!-- block: crumb --><!-- /block -->\r\n        <!-- block: tip --><!-- /block -->\r\n    </div>\r\n    <div class=\"list-page-content\">\r\n        <!-- block: main --><!-- /block -->\r\n    </div>\r\n</div>\r\n\r\n<!-- target: crumb -->\r\n<div data-ui-type=\"Crumb\" data-ui-id=\"crumb\">\r\n    <!-- block: path --><!-- /block -->\r\n</div>\r\n```\r\n\r\n输出结果不正确，`<!-- block: main -->World<!-- /block -->`的block内容没有被正确替换\r\n原因是由于target不存在嵌套，etpl2的语法也不可能出现import嵌套，导致实现没考虑到import嵌套的问题，在parse的过程，对于block的处理直接`(ctx.imp || ctx.target).blocks[name]=`了。"}}