{"id":201684,"date":"2013-11-14T15:36:02","date_gmt":"2013-11-14T11:36:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=201684"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=201684","title":{"rendered":"<span class=\"post_title\">\u041f\u0438\u0448\u0435\u043c \u0441\u0432\u043e\u0439 JavaScript \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0442\u043e\u0440<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u041d\u0430 \u0442\u0435\u043c\u0443 \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432 \u0441\u0442\u0430\u0442\u0435\u0439 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432\u0435\u043b\u0438\u043a\u043e\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u0437\u0434\u0435\u0441\u044c, \u043d\u0430 \u0445\u0430\u0431\u0440\u0435.<br \/>  \u0420\u0430\u043d\u044c\u0448\u0435 \u043c\u043d\u0435 \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u0432\u043e\u0451 \u2014 \u00ab\u043d\u0430 \u043a\u043e\u043b\u0435\u043d\u043a\u0435\u00bb \u2014 \u0431\u0443\u0434\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u0441\u043b\u043e\u0436\u043d\u043e.<br \/>  \u041d\u043e, \u0441\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0442\u0430\u043a, \u0447\u0442\u043e \u043f\u0440\u0438\u0441\u043b\u0430\u043b\u0438 \u043c\u043d\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u0435.<br \/>  \u041d\u0430\u043f\u0438\u0448\u0438, \u043c\u043e\u043b, JavaScript \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0442\u043e\u0440, \u0432\u043e\u0442 \u043f\u043e \u0442\u0430\u043a\u043e\u043c\u0443 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044e, \u0442\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u0434\u0451\u0448\u044c \u043d\u0430 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435.<br \/>  \u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0431\u044b\u043b\u043e \u0447\u0440\u0435\u0437\u043c\u0435\u0440\u043d\u044b\u043c, \u0438 \u043f\u043e\u043d\u0430\u0447\u0430\u043b\u0443 \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0433\u043d\u043e\u0440\u0438\u0442\u044c.<br \/>  \u041d\u043e \u0438\u0437 \u0441\u043f\u043e\u0440\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0430 \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c.<br \/>  \u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043d\u0435 \u0432\u0441\u0451 \u0442\u0430\u043a \u0441\u043b\u043e\u0436\u043d\u043e.<\/p>\n<p>  \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0435\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0442\u043e \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u043c\u0435\u0442\u043a\u0438 \u0438 \u0432\u044b\u0432\u043e\u0434\u044b \u043f\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0443 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f.<\/p>\n<p>  \u0414\u043b\u044f \u0442\u0435\u0445, \u043a\u043e\u043c\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u0433\u043b\u044f\u043d\u0443\u0442\u044c: <a href=\"http:\/\/wentout.github.io\/template_render_engine\/\">the result<\/a>, <a href=\"https:\/\/github.com\/wentout\/template_render_engine\/blob\/master\/tre.js\">the cat<\/a>.<\/p>\n<p>  <a name=\"habracut\"><\/a><\/p>\n<p>  \u0414\u0430\u043d\u043e:<\/p>\n<p>  <b>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d<\/b> \u2014 \u044d\u0442\u043e JS String(), \u0430 <b>\u0434\u0430\u043d\u043d\u044b\u0435<\/b> \u044d\u0442\u043e JS Object().<br \/>  <b>\u0411\u043b\u043e\u043a\u0438<\/b> \u0432\u0438\u0434\u0430 <b> {% name %} body {% \/ %} <\/b>, <b>\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430<\/b> \u043d\u0435\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u0430\u044f <b>\u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u044c<\/b>.<br \/>  <b>\u0415\u0441\u043b\u0438<\/b> \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 name \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <b>\u0441\u043f\u0438\u0441\u043a\u043e\u043c<\/b>, \u0442\u043e \u0432\u044b\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u0432\u0441\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b, <b>\u0438\u043d\u0430\u0447\u0435<\/b> \u0435\u0441\u043b\u0438 \u043d\u0435 undefined, \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f <b>\u043e\u0434\u0438\u043d<\/b> \u044d\u043b\u0435\u043c\u0435\u043d\u0442.<br \/>  <b>\u041f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438<\/b> \u0432\u0438\u0434\u0430: <b> {{ name }} <\/b>.<br \/>  \u0412 \u0431\u043b\u043e\u043a\u0430\u0445 \u0438 \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430\u0445 <b>\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e<\/b> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <b>\u0442\u043e\u0447\u0435\u043a<\/b> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u043c\u0435\u043d\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <b> {{.}} <\/b> \u0438\u043b\u0438 <b> {%.%} <\/b>, \u0433\u0434\u0435 \u0442\u043e\u0447\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 <b>\u0442\u0435\u043a\u0443\u0449\u0438\u043c<\/b> \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u0430 <b>\u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e<\/b> \u0443\u0440\u043e\u0432\u043d\u044f.<br \/>  \u0415\u0441\u0442\u044c \u0435\u0449\u0451 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u2014 \u044d\u0442\u043e <b> {# any comment w\\wo multiline #} <\/b>.<br \/>  \u0414\u043b\u044f \u0441\u0430\u043c\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u0444\u0438\u043b\u044c\u0442\u0440\u044b, \u0437\u0430\u0434\u0430\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0434\u0432\u043e\u0435\u0442\u043e\u0447\u0438\u0435: <b> {{ .:trim:capitalize\u2026 }} <\/b>.<\/p>\n<p>  \u0420\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043e\u043d\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u043a\u0430\u043a:<\/p>\n<pre><code class=\"javascript\">\tvar str = render (tpl, obj); <\/code><\/pre>\n<p>  \u0414\u043e\u043a\u0430\u0437\u0430\u0442\u044c: <br \/>  <b>+1 \u043a \u0441\u0430\u043c\u043e\u043e\u0446\u0435\u043d\u043a\u0435<\/b>.<\/p>\n<p>  \u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c.<\/p>\n<p>  \u0422.\u043a. \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u2014 \u044d\u0442\u043e \u0441\u0442\u0440\u043e\u043a\u0430, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430\u043c\u0438 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043e\u043a.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u043e\u0436\u043d\u043e \u0443\u0431\u0440\u0430\u0442\u044c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043e\u0442\u0441\u0432\u0435\u0447\u0438\u0432\u0430\u043b\u0438:<\/p>\n<pre><code class=\"javascript\">\t \t\/\/ to  cut the comments \ttpl = tpl.replace ( \/\\{#[^]*#\\}\/g, '' );  <\/code><\/pre>\n<p>  Hint: <b>[^]<\/b> \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043b\u044e\u0431\u043e\u0439 \u0441\u0438\u043c\u0432\u043e\u043b, <b>*<\/b> \u2014 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0433\u043e\u0434\u043d\u043e \u0440\u0430\u0437.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c \u043d\u0430\u0434 \u0442\u0435\u043c, \u043a\u0430\u043a \u0431\u0443\u0434\u0435\u043c \u043f\u0430\u0440\u0441\u0438\u0442\u044c \u00ab\u0447\u0438\u0441\u0442\u044b\u0439\u00bb \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<br \/>  \u0422\u0430\u043a \u043a\u0430\u043a \u0431\u043b\u043e\u043a\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432\u0441\u0451 \u0432 \u0432\u0438\u0434\u0435 \u0434\u0435\u0440\u0435\u0432\u0430.<br \/>  \u041d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u0434\u0435\u0440\u0435\u0432\u0430 \u0431\u0443\u0434\u0435\u0442 JS Array (), \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u043e\u0433\u0443\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443.<\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u0434\u0435\u043b\u0438\u0442\u044c \u043c\u0443\u0445 \u043e\u0442 \u043a\u043e\u0442\u043b\u0435\u0442.<br \/>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044f \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f <a href=\"http:\/\/www.w3schools.com\/jsref\/jsref_split.asp\">String.split()<\/a> \u0438 <a href=\"http:\/\/www.w3schools.com\/jsref\/jsref_match.asp\">String.match()<\/a>.<\/p>\n<p>  \u0415\u0449\u0451 \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0433\u043b\u0443\u0431\u043e\u043a\u0438\u0439 <b>\u043f\u043e\u0438\u0441\u043a \u043f\u043e<\/b> \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u043e\u043c\u0443 <b>val<\/b> \u0438\u043c\u0435\u043d\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 <b>obj<\/b>.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u043d\u0451\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 getObjDeep:<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\"> \tvar deeps = function (obj, val) { \t\tvar hs = val.split('.'); \t\tvar len = hs.length; \t\tvar deep; \t\tvar num = 0; \t\tfor (var i = 0; i &lt; len; i++) { \t\t\tvar el = hs[i]; \t\t\tif (deep) { \t\t\t\tif (deep[el]) { \t\t\t\t\tdeep = deep[el]; \t\t\t\t\tnum++; \t\t\t\t} \t\t\t} else { \t\t\t\tif (obj[el]) { \t\t\t\t\tdeep = obj[el]; \t\t\t\t\tnum++; \t\t\t\t} \t\t\t} \t\t} \t\tif (num == len) { \t\t\treturn deep; \t\t} else { \t\t\treturn undefined; \t\t} \t};  <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0418 \u0441\u0440\u0430\u0437\u0443 \u0442\u0443\u0442 \u0441\u043a\u0430\u0436\u0443 \u0421\u041f\u0410\u0421\u0418\u0411\u041e, <a href=\"http:\/\/habrahabr.ru\/users\/subzey\/\" class=\"user_link\">subzey<\/a> \u0437\u0430 <a href=\"https:\/\/github.com\/wentout\/template_render_engine\/commit\/4b850e41c8de878d2b2ecd1fc6214a6ed7cbe6b7\"> greedy quantificator fix <\/a>.<br \/>  \u0418\u0442\u0430\u043a, \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043c \u0441\u0442\u0440\u043e\u043a\u0443 \u043d\u0430 \u0447\u0430\u0441\u0442\u0438 parts \u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b matches:<\/p>\n<pre><code class=\"javascript\"> \t\/\/ \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u0430 \u0434\u043b\u044f \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430, \u0446\u0438\u0444\u0440\u043e\u0431\u0443\u043a\u0432\u044b, \t\/\/ \u0442\u043e\u0447\u043a\u0430, \u043f\u043e\u0434\u0447\u0435\u0440\u043a\u0438\u0432\u0430\u043d\u0438\u0435,  \t\/\/ \u0434\u0432\u043e\u0435\u0442\u043e\u0447\u0438\u0435 \u0441\u043b\u0435\u0448 \u0438 \u043c\u0438\u043d\u0443\u0441, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0433\u043e\u0434\u043d\u043e \u0440\u0430\u0437 \tvar ptn = \/\\{\\%\\s*[a-zA-Z0-9._\/:-]+?\\s*\\%\\}\/g;  \t\/\/ \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0435 \u043a\u0443\u0441\u043a\u0438 \tvar parts = tpl.split (ptn);  \t\/\/ \u0441\u0430\u043c\u0438 \u0441\u043f\u0438\u0447\u043a\u0438 \tvar matches = tpl.match (ptn);   <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0440\u0430\u0437\u0431\u043e\u0440\u0430 \u043f\u043e\u043b\u0451\u0442\u043e\u0432 \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0434\u0432\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430.<br \/>  \u0412 \u043e\u0434\u043d\u043e\u043c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0431\u043b\u043e\u043a\u0438, \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0438\u0437 \u0446\u0438\u043a\u043b\u0430 \u043f\u043e \u0441\u043f\u0438\u0447\u043a\u0430\u043c.<\/p>\n<pre><code class=\"javascript\"> \t\/\/ \u0432\u0441\u0435 \u0431\u043b\u043e\u043a\u0438 \tvar blocks = [];  \t\/\/ \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \tvar curnt = [];  \tif( matches ){ \/\/ \u0442.\u043a. \u043c.\u0431. null  \t\tvar len = matches.length; \t\tfor ( var i = 0; i &lt; len; i++ ) {  \t\t\t\/\/ \u0432\u044b\u043a\u0438\u0434\u044b\u0432\u0430\u0435\u043c {% \u0438 %}, \u0438 \u043f\u043e\u043f\u0443\u0442\u043d\u043e \u0434\u0435\u043b\u0430\u0435\u043c trim \t\t\tvar str = matches[i].replace (\/^\\{\\%\\s*|\\s*\\%\\}$\/g, '');  \t\t\tif (str === '\/') {  \t\t\t\t\/\/ finalise block \t\t\t\t\/\/ ...  \t\t\t} else { \t\t\t\t \t\t\t\t\/\/ make block \t\t\t\t\/\/ ...  \t\t\t}  \t\t\/\/ ...  <\/code><\/pre>\n<p>  \u0422\u0443\u0442 blocks \u2014 \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0441 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u044b\u043d\u043c\u0438 \u0431\u043b\u043e\u043a\u0430\u043c\u0438, \u0430 curnt \u2014 \u043c\u0430\u0441\u0441\u0438\u0432 \u0441 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e.<\/p>\n<p>  \u041d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0448\u0430\u0433\u0435 \u0446\u0438\u043a\u043b\u0430 \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c, \u0447\u0442\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u0432 str, \u043d\u0430\u0447\u0430\u043b\u043e \u0431\u043b\u043e\u043a\u0430 \u0438\u043b\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435.<br \/>  \u0415\u0441\u043b\u0438 \u043d\u0430\u0447\u0430\u043b\u043e \u0431\u043b\u043e\u043a\u0430, \u0442.\u0435. <b> str !== &#8216;\/&#8217; <\/b>, \u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043d\u043e\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0438 push \u0435\u0433\u043e \u0432 \u043c\u0430\u0441\u0441\u0438\u0432.<br \/>  \u0418 \u0435\u0449\u0451 push \u0435\u0433\u043e \u0432 curnt, \u0442.\u043a. \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u043d\u0430 \u043a\u0430\u043a\u043e\u043c \u043c\u044b \u0443\u0440\u043e\u0432\u043d\u0435.<br \/>  \u041f\u043e\u043f\u0443\u0442\u043d\u043e \u0437\u0430\u043d\u043e\u0441\u0438\u043c \u0432 \u0431\u043b\u043e\u043a \u0441\u0430\u043c\u0438 \u0441\u0442\u0440\u043e\u043a\u0438.<br \/>  \u0421\u043e\u043e\u0442\u0432\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u043f\u0443\u0441\u0442\u043e\u0439 curnt, \u0442\u043e \u043c\u044b \u043d\u0430 \u043d\u0443\u043b\u0435\u0432\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u0434\u0435\u0440\u0435\u0432\u0430.<br \/>  \u0415\u0441\u043b\u0438 curnt \u043d\u0435 \u043f\u0443\u0441\u0442\u043e\u0439, \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043d\u043e\u0441\u0438\u0442\u044c \u0432 nested \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e curnt.<\/p>\n<pre><code class=\"javascript\">\t \t\/\/ \u0434\u043b\u0438\u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \tvar cln = curnt.length;  \tif (cln == 0) { \t\t \t\t\/\/ \u0442.\u043a. \u044d\u0442\u043e \u0432\u0435\u0440\u0445\u043d\u0438\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c, \u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0432 \u043d\u0435\u0433\u043e \u0438 \u043a\u043b\u0430\u0434\u0451\u043c \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \t\tblocks.push ( struct );  \t\t\/\/ \u043f\u0438\u0448\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u044c, \u043e\u043d\u0430 \u0436\u0435 \u043d\u0443\u043b\u0435\u0432\u0430\u044f \t\tcurnt.push ( struct );  \t} else {  \t\t\/\/ \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0432 nested \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430 \t\tcurnt[cln - 1].nest.push ( struct );  \t\t\/\/ \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u0437\u044f\u0442\u044c \u044d\u0442\u043e\u0442 &quot;\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439&quot; \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u0432 curnt \t\tvar last = curnt[cln - 1].nest.length - 1; \t\tcurnt.push ( curnt[cln - 1].nest [ last ] );  \t}  <\/code><\/pre>\n<p>  \u0421\u043e\u043e\u0442\u0432\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u044d\u0442\u043e, \u043c\u0438\u043d\u0438\u043c\u0443\u043c:<\/p>\n<pre><code class=\"javascript\"> \tvar struct = {  \t\t\/\/ \u0442\u0435\u043a\u0443\u0449\u0438\u0439 obj \u0434\u043b\u044f \u0431\u043b\u043e\u043a\u0430 \t\tcnt: deeps( obj, str ), \t\t\/\/ \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438 \t\tnest: [], \t\t\/\/ \u0441\u0442\u0440\u043e\u043a\u0430 \u043f\u0435\u0440\u0435\u0434 \u0432\u0441\u0435\u043c\u0438 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u043c\u0438 \u0431\u043b\u043e\u043a\u0430\u043c\u0438 \t\tbe4e: parts[ i + 1 ], \t\t \t\t\/\/ str -- \u0441\u0442\u0440\u043e\u043a\u0430, \u0438\u0434\u0443\u0449\u0430\u044f \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \t\t\/\/ cnt -- \u0431\u043b\u043e\u043a-\u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c, \u043f\u0430\u0440\u0441\u0438\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443 \u0431\u0443\u0434\u0435\u043c \u0432 \u0435\u0433\u043e \u0440\u0430\u043c\u043a\u0430\u0445 \t\taf3e: { \t\t\tcnt: null, \t\t\tstr: '' \t\t}  \t};  <\/code><\/pre>\n<p>  \u0422.\u043a. \u0443 \u043d\u0430\u0441 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u0441\u043b\u0435 \u0431\u043b\u043e\u043a\u0430 \u0435\u0441\u0442\u044c \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0435\u0449\u0451, \u0442\u043e \u0437\u0434\u0435\u0441\u044c <b> af3e.str <\/b> \u0438 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u043e\u0439, \u0438\u0434\u0443\u0449\u0435\u0439 \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 {% \/ %} \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0431\u043b\u043e\u043a\u0430. \u0412\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0431\u043b\u043e\u043a\u0430, \u0442\u0430\u043a \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u0435\u0439.<br \/>  \u0412 \u044d\u0442\u043e\u0442 \u0436\u0435 \u043c\u043e\u043c\u0435\u043d\u0442 \u043c\u044b \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 curnt.<\/p>\n<pre><code class=\"javascript\"> \tif (str === '\/') {  \t\t\/\/ \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 curnt  \t\t\/\/ \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u0435\u043c \t\t\/\/ \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0432\u0448\u0435\u0433\u043e\u0441\u044f \u0441\u0435\u0439\u0447\u0430\u0441 \u0431\u043b\u043e\u043a\u0430 \t\tcurnt [cln - 1].af3e = { \t\t\tcnt: ( curnt [ cln - 2 ] ?  curnt [ cln - 2 ].cnt : obj ), \t\t\tstr: parts[ i + 1 ] \t\t}; \t\tcurnt.pop();  <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043e\u0434\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0443\u0442 \u0432\u0441\u0435 \u043d\u0443\u0436\u043d\u044b\u0435 \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0438 \u0441 \u0438\u0445 \u0442\u0435\u043a\u0443\u0449\u0438\u043c\u0438 obj.<br \/>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u00ab\u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u00bb \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0438\u0439\u0441\u044f blocks, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u0447\u0442\u043e \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0441\u043f\u0438\u0441\u043a\u0438.<br \/>  \u041f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0438, \u043d\u043e \u0432 \u0446\u0435\u043b\u043e\u043c \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u0436\u0435 \u043d\u0435 \u0442\u0430\u043a \u0441\u043b\u043e\u0436\u043d\u043e.<\/p>\n<pre><code class=\"javascript\"> \t\/\/ \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u0442\u0440\u043e\u043a \u0434\u043b\u044f \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u0435\u0439 \u0431\u043b\u043e\u043a\u043e\u0432 \tvar stars = [ [ parts[0], obj ] ]; \tparseBlocks( blocks, stars );  <\/code><\/pre>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u044b\u0439 \u0432\u0438\u0434 parseBlocks()<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">\t \tvar parseBlocks = function ( blocks, stars ) {  \t\tvar len = blocks.length; \t\tfor (var i = 0; i &lt; len; i++) { \t\t\t \t\t\tvar block = blocks [i];  \t\t\tif (block.cnt) { \t\t\t\tvar current = block.cnt;  \t\t\t\tswitch ( Object.prototype.toString.call( current ) ) { \t\t\t\t\tcase '[object Array]': \t\t\t\t\t\tvar len1 = current.length; \t\t\t\t\t\tfor ( var k = 0; k &lt; len1; k++ ) { \t\t\t\t\t\t\tstars.push ( [ block.be4e, current[k] ] ); \t\t\t\t\t\t\tparseBlocks( block.nest, stars ); \t\t\t\t\t\t} \t\t\t\t\t\tbreak; \t\t\t\t\tcase '[object Object]': \t\t\t\t\t\tfor (var k in current) { \t\t\t\t\t\t\tif (current.hasOwnProperty(k)) { \t\t\t\t\t\t\t\tstars.push ( [ block.be4e, current[k] ] ); \t\t\t\t\t\t\t\tparseBlocks( block.nest, stars ); \t\t\t\t\t\t\t} \t\t\t\t\t\t} \t\t\t\t\t\tbreak; \t\t\t\t\tdefault: \t\t\t\t\t\tstars.push ( [ block.be4e, current ] ); \t\t\t\t\t\tparseBlocks( block.nest, stars ); \t\t\t\t}  \t\t\t\tstars.push ( [ block.af3e.str, block.af3e.cnt ] ); \t\t\t}  \t\t}  \t};  <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u043f\u043e\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043d\u043e \u0435\u0433\u043e \u0440\u0430\u0441\u043f\u0430\u0440\u0441\u0438\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0438\u0439\u0441\u044f stars \u0438, \u0441\u043e\u0431\u0440\u0430\u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0441\u0442\u0440\u043e\u043a\u0443, \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<pre><code class=\"javascript\"> \tvar pstr = [];  \tvar len = stars.length; \tfor ( var i = 0; i &lt; len; i++ ) { \t\tpstr.push( parseStar ( stars[i][0], stars[i][1] ) ); \t}  \t\/\/ \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: \treturn pstr.join ('');  <\/code><\/pre>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u044b\u0439 \u0432\u0438\u0434 parseStar()<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">\t \tvar parseStar = function ( part, current ) {  \t\tvar str = ''; \t\tvar ptn = \/\\{\\{\\s*.+?\\s*\\}\\}\/g;  \t\tvar parts = part.split (ptn); \t\tvar matches = part.match (ptn);  \t\tstr += parts[0];  \t\tif (matches) { \t\t\t \t\t\tvar len = matches.length; \t\t\tfor (var i = 0; i &lt; len; i++) { \t\t\t\t \t\t\t\tvar match = matches [i]; \t\t\t\tvar el = match.replace(\/^\\{\\{\\s*|\\s*\\}\\}$\/g, ''); \t\t\t\tvar strel = ''; \t\t\t\tvar deep = deeps( current, el ); \t\t\t\tdeep && ( strel += deep ); \t\t\t\tstr += strel;  \t\t\t} \t\t\t \t\t\tif (len &gt; 0) { \t\t\t\tstr += parts[ len ]; \t\t\t} \t\t}  \t\treturn str; \t}  <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043c\u0435\u043d\u044c\u0448\u0435 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430.<br \/>  \u0422\u0430\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u044f \u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u0442\u0435\u043a\u0443\u0449\u0438\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c, \u0435\u0441\u043b\u0438 \u043e\u043d \u0437\u0430\u0434\u0430\u043d \u043a\u0430 \u0442\u043e\u0447\u043a\u0430. \u0422\u0430\u043a \u0436\u0435 \u044f \u043d\u0435 \u043f\u0440\u0438\u0432\u0451\u043b \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432.<br \/>  \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e \u0432 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435, \u044f \u00ab\u043e\u0442 \u0441\u0435\u0431\u044f\u00bb \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0432 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0439, \u043a\u043e\u0433\u0434\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0438\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438.<\/p>\n<p>  \u041d\u043e \u043c\u043e\u0435\u0439 \u0446\u0435\u043b\u044c\u044e \u0431\u044b\u043b\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u0430\u043c\u0443 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044e\u2026<\/p>\n<p>  \u0410 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u043a\u0430\u043a \u0443\u0436\u0435 \u0431\u044b\u043b\u043e \u0441\u043a\u0430\u0437\u0430\u043d\u043e \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0441\u0442\u0430\u0442\u044c\u0438, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/github.com\/wentout\/template_render_engine\/blob\/master\/tre.js\">\u0437\u0434\u0435\u0441\u044c<\/a>.<br \/>  \u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u0441\u043b\u0435 \u044f \u043f\u043e\u0448\u0451\u043b \u043d\u0430 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043b\u0435\u0436\u0438\u0442 <a href=\"http:\/\/wentout.github.io\/template_render_engine\/\">\u0442\u0443\u0442<\/a>.<\/p>\n<p>  \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u043a\u043e\u043c\u0443-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f.<br \/>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435!<\/p>\n<p>  \ud83d\ude42    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/201684\/\"> http:\/\/habrahabr.ru\/post\/201684\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u041d\u0430 \u0442\u0435\u043c\u0443 \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432 \u0441\u0442\u0430\u0442\u0435\u0439 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432\u0435\u043b\u0438\u043a\u043e\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u0437\u0434\u0435\u0441\u044c, \u043d\u0430 \u0445\u0430\u0431\u0440\u0435.<br \/>  \u0420\u0430\u043d\u044c\u0448\u0435 \u043c\u043d\u0435 \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u0432\u043e\u0451 \u2014 \u00ab\u043d\u0430 \u043a\u043e\u043b\u0435\u043d\u043a\u0435\u00bb \u2014 \u0431\u0443\u0434\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u0441\u043b\u043e\u0436\u043d\u043e.<br \/>  \u041d\u043e, \u0441\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0442\u0430\u043a, \u0447\u0442\u043e \u043f\u0440\u0438\u0441\u043b\u0430\u043b\u0438 \u043c\u043d\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u0435.<br \/>  \u041d\u0430\u043f\u0438\u0448\u0438, \u043c\u043e\u043b, JavaScript \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0442\u043e\u0440, \u0432\u043e\u0442 \u043f\u043e \u0442\u0430\u043a\u043e\u043c\u0443 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044e, \u0442\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u0434\u0451\u0448\u044c \u043d\u0430 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435.<br \/>  \u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0431\u044b\u043b\u043e \u0447\u0440\u0435\u0437\u043c\u0435\u0440\u043d\u044b\u043c, \u0438 \u043f\u043e\u043d\u0430\u0447\u0430\u043b\u0443 \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0433\u043d\u043e\u0440\u0438\u0442\u044c.<br \/>  \u041d\u043e \u0438\u0437 \u0441\u043f\u043e\u0440\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0430 \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c.<br \/>  \u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043d\u0435 \u0432\u0441\u0451 \u0442\u0430\u043a \u0441\u043b\u043e\u0436\u043d\u043e.<\/p>\n<p>  \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0435\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0442\u043e \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u043c\u0435\u0442\u043a\u0438 \u0438 \u0432\u044b\u0432\u043e\u0434\u044b \u043f\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0443 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f.<\/p>\n<p>  \u0414\u043b\u044f \u0442\u0435\u0445, \u043a\u043e\u043c\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u0433\u043b\u044f\u043d\u0443\u0442\u044c: <a href=\"http:\/\/wentout.github.io\/template_render_engine\/\">the result<\/a>, <a href=\"https:\/\/github.com\/wentout\/template_render_engine\/blob\/master\/tre.js\">the cat<\/a>.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-201684","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/201684","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=201684"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/201684\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=201684"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=201684"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=201684"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}