{"action":"created","issue":{"url":"https://api.github.com/repos/bem/bem-forum-content-ru/issues/343","labels_url":"https://api.github.com/repos/bem/bem-forum-content-ru/issues/343/labels{/name}","comments_url":"https://api.github.com/repos/bem/bem-forum-content-ru/issues/343/comments","events_url":"https://api.github.com/repos/bem/bem-forum-content-ru/issues/343/events","html_url":"https://github.com/bem/bem-forum-content-ru/issues/343","id":65626714,"number":343,"title":"Добавление БЭМ-сущностей для задач вёрстки не работает","user":{"login":"raulleo","id":5909355,"avatar_url":"https://avatars.githubusercontent.com/u/5909355?v=3","gravatar_id":"","url":"https://api.github.com/users/raulleo","html_url":"https://github.com/raulleo","followers_url":"https://api.github.com/users/raulleo/followers","following_url":"https://api.github.com/users/raulleo/following{/other_user}","gists_url":"https://api.github.com/users/raulleo/gists{/gist_id}","starred_url":"https://api.github.com/users/raulleo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raulleo/subscriptions","organizations_url":"https://api.github.com/users/raulleo/orgs","repos_url":"https://api.github.com/users/raulleo/repos","events_url":"https://api.github.com/users/raulleo/events{/privacy}","received_events_url":"https://api.github.com/users/raulleo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/bem/bem-forum-content-ru/labels/asktheteam","name":"asktheteam","color":"fef2c0"},{"url":"https://api.github.com/repos/bem/bem-forum-content-ru/labels/bem.info","name":"bem.info","color":"bfe5bf"},{"url":"https://api.github.com/repos/bem/bem-forum-content-ru/labels/bemhtml","name":"bemhtml","color":"bfe5bf"},{"url":"https://api.github.com/repos/bem/bem-forum-content-ru/labels/documentation","name":"documentation","color":"c7def8"},{"url":"https://api.github.com/repos/bem/bem-forum-content-ru/labels/project-stub","name":"project-stub","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-04-01T07:54:06Z","updated_at":"2015-04-01T14:11:47Z","closed_at":null,"body":"Пример [Добавление БЭМ-сущностей для задач вёрстки](https://ru.bem.info/technology/bemhtml/v2/reference/#Добавление-БЭМ-сущностей-для-задач-вёрстки) из руководства по BEMHTML выдает ошибку:\r\n```\r\nError: Only literal or function is allowed in template's body\r\n   at Compiler.assert (/vagrant/project-stub/node_modules/enb-bemxjst/node_modules/bem-xjst/node_modules/xjst/lib/xjst/compiler/base.js:180:9)\r\n   at Compiler.transformTemplates (/vagrant/project-stub/node_modules/enb-bemxjst/node_modules/bem-xjst/node_modules/xjst/lib/xjst/compiler/base.js:648:8)\r\n   at Array.map (native)\r\n   at Compiler.translate (/vagrant/project-stub/node_modules/enb-bemxjst/node_modules/bem-xjst/node_modules/xjst/lib/xjst/compiler/base.js:201:41)\r\n   at Object.translate (/vagrant/project-stub/node_modules/enb-bemxjst/node_modules/bem-xjst/node_modules/xjst/lib/xjst/api.js:16:40)\r\n   at Compiler.translate (/vagrant/project-stub/node_modules/enb-bemxjst/node_modules/bem-xjst/lib/bemhtml/compiler.js:121:35)\r\n   at Compiler.generate (/vagrant/project-stub/node_modules/enb-bemxjst/node_modules/bem-xjst/lib/bemhtml/compiler.js:707:14)\r\n   at Object.generate (/vagrant/project-stub/node_modules/enb-bemxjst/node_modules/bem-xjst/lib/bemhtml/api.js:16:40)\r\n   at require.declare.process (/vagrant/project-stub/node_modules/enb-bemxjst/techs/bem-xjst.js:7:28)\r\n   at /vagrant/project-stub/node_modules/enb-bemxjst/node_modules/sibling/lib/runner.js:22:48\r\n```\r\n\r\nГугление подсказало обернуть матчинг флага в анонимную функцию:\r\n```js\r\nblock('box').match(function() { return !this.ctx._processed; })\r\n```\r\n\r\nНе помогло.\r\n\r\nОбернул вызов applyCtx:\r\n```js\r\nblock('box').match(function() { return !this.ctx._processed; }).content()(function() {\r\n    applyCtx({'ctx._processed':true}, {\r\n        elem: 'left-top',\r\n        content: {\r\n            elem: 'right-top',\r\n            content: {\r\n                elem: 'right-bottom',\r\n                content: {\r\n                    elem: 'left-bottom',\r\n                    content: applyNext()\r\n                }\r\n            }\r\n        }\r\n    });\r\n})\r\n```\r\n\r\nОшибка пропала, но html сгенерировался криво:\r\n```html\r\n<div class=\"box\">\r\n    <div class=\"box\">text</div>\r\n    <div class=\"box__left-top\">\r\n        <div class=\"box__right-top\">\r\n            <div class=\"box__right-bottom\">\r\n                <div class=\"box__left-bottom\"></div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</div>\r\n```\r\n\r\nПодскажите, как правильно делать такую банальную вещь?"},"comment":{"url":"https://api.github.com/repos/bem/bem-forum-content-ru/issues/comments/88499769","html_url":"https://github.com/bem/bem-forum-content-ru/issues/343#issuecomment-88499769","issue_url":"https://api.github.com/repos/bem/bem-forum-content-ru/issues/343","id":88499769,"user":{"login":"varya","id":27215,"avatar_url":"https://avatars.githubusercontent.com/u/27215?v=3","gravatar_id":"","url":"https://api.github.com/users/varya","html_url":"https://github.com/varya","followers_url":"https://api.github.com/users/varya/followers","following_url":"https://api.github.com/users/varya/following{/other_user}","gists_url":"https://api.github.com/users/varya/gists{/gist_id}","starred_url":"https://api.github.com/users/varya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/varya/subscriptions","organizations_url":"https://api.github.com/users/varya/orgs","repos_url":"https://api.github.com/users/varya/repos","events_url":"https://api.github.com/users/varya/events{/privacy}","received_events_url":"https://api.github.com/users/varya/received_events","type":"User","site_admin":false},"created_at":"2015-04-01T14:11:47Z","updated_at":"2015-04-01T14:11:47Z","body":"@veged А давайте писать зависимости как в Ангуляре? Ну, всмысле не прямо так, а по такой же идее. Вначале css-файла делать `@import` нужных. В начале js-файлов уже всё написано, там же модульная система. И для bemhtml что-нибудь подобное ввести. Потом сборщик всё это считывает и собирает так же как сейчас."}}